san %>% 
  #filter(!is.na(zipcode)) %>% 
  ggplot(aes(x = zipcode, fill = duration_min_out)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2, color = "black") +
  scale_fill_brewer(type = "div", palette = 'Spectral') +
  #facet_grid(~ zipcode) +
  ggtitle("Duration between 0.7 min and 97.3 min = NORMAL (95% of responses)") +
  xlab("Zip code") + 
  theme_classic() +
  theme(axis.text.x = element_text(angle = 90, size = 9), 
        panel.background = element_rect(fill = "gray95"))

san %>% 
  #filter(!is.na(zipcode)) %>% 
  ggplot(aes(x = zipcode, fill = duration_min_out2)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2, color = "black") +
  scale_fill_brewer(type = "div", palette = 'Spectral') +
  #facet_grid(~ zipcode) +
  ggtitle("Duration between 1.36 min and 71.2 min = NORMAL (90% of reponses)") +
  xlab("Zip code") + 
  theme_classic() +
  theme(axis.text.x = element_text(angle = 90, size = 9), 
        panel.background = element_rect(fill = "gray95"))

san %>% 
  #filter(!is.na(zipcode)) %>% 
  ggplot(aes(x = zipcode, fill = nas_out)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2, color = "black") +
  scale_fill_brewer(type = "div", palette = 'Spectral') +
  #facet_grid(~ zipcode) +
  ggtitle("Number of NAs between 5 and 58 = NORMAL") +
  xlab("Zip code") + 
  theme_classic() +
  theme(axis.text.x = element_text(angle = 90, size = 9), 
        panel.background = element_rect(fill = "gray95"))

plot_ly(data = san, x = ~nas_pct, y = ~duration, color = ~duration_min_out2) %>% 
  layout(title = "Duration (min) by NAs by response (%)", 
         yaxis = list(title = "Duration (min)"),
         xaxis = list(title = "Percentage of NA values"))
san %>% 
  filter(!is.na(zipcode)) %>% 
  ggplot() +
  geom_boxplot(aes(y = nas_pct, x = duration_min_out)) +
  scale_fill_brewer(type = "div", palette = 'Spectral') +
  ggtitle("NA dist. by duration in minutes") +
  xlab("Duration between 0.7 min and 97.3 min = NORMAL (95% of responses)") + 
  theme_classic() +
  theme(axis.text.x = element_text(size = 9), 
        panel.background = element_rect(fill = "gray95"))

san %>% 
  filter(!is.na(zipcode)) %>% 
  ggplot() +
  geom_boxplot(aes(y = nas_pct, x = duration_min_out, fill = as.factor(zipcode))) +
  scale_fill_brewer(type = "div", palette = 'Spectral') +
  ggtitle("NA dist. by duration in minutes by zip code") +
  xlab("Duration between 0.7 min and 97.3 min = NORMAL (95% of responses)") + 
  theme_classic() +
  theme(axis.text.x = element_text(size = 9), 
        panel.background = element_rect(fill = "gray95"))

san %>% 
  filter(!is.na(zipcode), duration < 900) %>% 
  ggplot() +
  geom_boxplot(aes(y = duration, fill = as.factor(zipcode), x = nas_out)) +
  scale_fill_brewer(type = "div", palette = 'Spectral') +
  ggtitle("Duration (min) by zip code and NA distribution") +
  xlab("Zip code") + 
  theme_classic() +
  theme(axis.text.x = element_text(size = 9), 
        panel.background = element_rect(fill = "gray95"))

  1. Locate “odd responses” based on duration and number of NA in each response
  2. Duration: a) Keep responses in (2.5%, 97.5%), b) responses in (5%, 95%)
  3. NAs: a) Responses in (10%, 90%)

Part I.

view(dfSummary(san[, 5:173], plain.ascii = F, graph.magnif = .75, labels.col = T, max.string.width = 15), method = "render")

Data Frame Summary

san

Dimensions: 1013 x 169
Duplicates: 0
No Variable Stats / Values Freqs (% of Valid) Graph Valid Missing
1 Progress [numeric] Mean (sd) : 91.1 (26.8) min < med < max: 0 < 100 < 100 IQR (CV) : 0 (0.3) 35 distinct values 1013 (100.0%) 0 (0.0%)
2 Duration (in seconds) [numeric] Mean (sd) : 1746.6 (3597.5) min < med < max: 10 < 1219 < 82589 IQR (CV) : 1220 (2.1) 841 distinct values 1013 (100.0%) 0 (0.0%)
3 Finished [numeric] Min : 0 Mean : 0.9 Max : 1
0:110(10.9%)
1:903(89.1%)
1013 (100.0%) 0 (0.0%)
4 RecordedDate [POSIXct, POSIXt] min : 2021-02-22 14:32:03 med : 2021-02-23 12:42:57 max : 2021-03-04 02:05:00 range : 9d 11H 32M 57S 984 distinct values 1013 (100.0%) 0 (0.0%)
5 ResponseId [character] 1. R_01F3YkgcZF3LT 2. R_0Ak2tVjB09xye 3. R_0Au0Xh2TGsWoJ 4. R_0BXTlGwZGOnMe 5. R_0c60ihjCKT6Rb 6. R_0CFUnzIgwaZ1t 7. R_0fxfBNmeY6qlJ 8. R_0HXvwzj23fxTW 9. R_0ilrJc7CA6LRe 10. R_0IpsG07KZKdcO [ 1003 others ]
1(0.1%)
1(0.1%)
1(0.1%)
1(0.1%)
1(0.1%)
1(0.1%)
1(0.1%)
1(0.1%)
1(0.1%)
1(0.1%)
1003(99.0%)
1013 (100.0%) 0 (0.0%)
6 LocationLatitude [numeric] Mean (sd) : 33.6 (5.2) min < med < max: 21.4 < 32.9 < 61.6 IQR (CV) : 7.8 (0.2) 431 distinct values 903 (89.1%) 110 (10.9%)
7 LocationLongitude [numeric] Mean (sd) : -92.6 (44.6) min < med < max: -158 < -98.5 < 117.3 IQR (CV) : 21.4 (-0.5) 432 distinct values 903 (89.1%) 110 (10.9%)
8 DistributionChannel [character] 1. anonymous
1013(100.0%)
1013 (100.0%) 0 (0.0%)
9 UserLanguage [character] 1. EN 2. ES
1012(99.9%)
1(0.1%)
1013 (100.0%) 0 (0.0%)
10 consent [numeric] Min : 1 Mean : 1 Max : 2
1:1012(99.9%)
2:1(0.1%)
1013 (100.0%) 0 (0.0%)
11 disagree [numeric] 1 distinct value
1:1(100.0%)
1 (0.1%) 1012 (99.9%)
12 zipcode [numeric] Mean (sd) : 1.5 (0.6) min < med < max: 1 < 1 < 3 IQR (CV) : 1 (0.4)
1:543(55.7%)
2:369(37.8%)
3:63(6.5%)
975 (96.2%) 38 (3.8%)
13 per_care_1 [numeric] Mean (sd) : 7.9 (1.7) min < med < max: 0.6 < 8 < 20.5 IQR (CV) : 1.1 (0.2) 98 distinct values 896 (88.5%) 117 (11.5%)
14 per_care_2 [numeric] Mean (sd) : 1.9 (7.1) min < med < max: -99 < 1.9 < 17.9 IQR (CV) : 1.4 (3.7) 92 distinct values 896 (88.5%) 117 (11.5%)
15 per_care_3 [numeric] Mean (sd) : -0.5 (15.8) min < med < max: -99 < 1.5 < 21.4 IQR (CV) : 1 (-30.5) 87 distinct values 896 (88.5%) 117 (11.5%)
16 per_care_4 [numeric] Mean (sd) : 0 (13.5) min < med < max: -99 < 1 < 17.8 IQR (CV) : 0.9 (-477.6) 83 distinct values 896 (88.5%) 117 (11.5%)
17 per_care_wknd_1 [numeric] Min : 4 Mean : 4.6 Max : 5
4:394(44.2%)
5:498(55.8%)
892 (88.1%) 121 (11.9%)
18 per_care_wknd_2 [numeric] Min : 4 Mean : 4.5 Max : 5
4:435(48.9%)
5:454(51.1%)
889 (87.8%) 124 (12.2%)
19 per_care_wknd_3 [numeric] Min : 4 Mean : 4.5 Max : 5
4:472(54.2%)
5:399(45.8%)
871 (86.0%) 142 (14.0%)
20 per_care_wknd_4 [numeric] Min : 4 Mean : 4.4 Max : 5
4:522(59.6%)
5:354(40.4%)
876 (86.5%) 137 (13.5%)
21 pc_wknd_time_1 [numeric] Mean (sd) : 9 (5.3) min < med < max: -99 < 9 < 19 IQR (CV) : 1.9 (0.6) 86 distinct values 498 (49.2%) 515 (50.8%)
22 pc_wknd_time_2 [numeric] Mean (sd) : 3.5 (5.6) min < med < max: -99 < 2.8 < 19.1 IQR (CV) : 2.5 (1.6) 96 distinct values 453 (44.7%) 560 (55.3%)
23 pc_wknd_time_3 [numeric] Mean (sd) : 2.3 (7.6) min < med < max: -99 < 2 < 20.6 IQR (CV) : 1.5 (3.3) 86 distinct values 399 (39.4%) 614 (60.6%)
24 pc_wknd_time_4 [numeric] Mean (sd) : 2.1 (6) min < med < max: -99 < 1.5 < 19.7 IQR (CV) : 1.7 (2.9) 73 distinct values 353 (34.8%) 660 (65.2%)
25 per_care_covid_1 [numeric] Mean (sd) : 3.5 (1) min < med < max: 1 < 3 < 5 IQR (CV) : 1 (0.3)
1:32(3.6%)
2:63(7.1%)
3:364(41.0%)
4:251(28.3%)
5:177(20.0%)
887 (87.6%) 126 (12.4%)
26 per_care_covid_2 [numeric] Mean (sd) : 3.5 (0.9) min < med < max: 1 < 3 < 5 IQR (CV) : 1 (0.2)
1:2(0.2%)
2:87(9.8%)
3:424(47.8%)
4:254(28.6%)
5:120(13.5%)
887 (87.6%) 126 (12.4%)
27 per_care_covid_3 [numeric] Mean (sd) : 3.5 (0.9) min < med < max: 1 < 3 < 6 IQR (CV) : 1 (0.3)
1:10(1.1%)
2:70(7.9%)
3:445(50.2%)
4:233(26.3%)
5:124(14.0%)
6:5(0.6%)
887 (87.6%) 126 (12.4%)
28 per_care_covid_4 [numeric] Mean (sd) : 3.3 (0.9) min < med < max: 1 < 3 < 6 IQR (CV) : 1 (0.3)
1:17(1.9%)
2:94(10.6%)
3:459(51.7%)
4:225(25.4%)
5:88(9.9%)
6:4(0.5%)
887 (87.6%) 126 (12.4%)
29 st_act_1 [numeric] Mean (sd) : -19.5 (44.6) min < med < max: -99 < 3.8 < 18.4 IQR (CV) : 6.6 (-2.3) 121 distinct values 886 (87.5%) 127 (12.5%)
30 st_act_2 [numeric] Mean (sd) : -26 (45.9) min < med < max: -99 < 1.2 < 20.7 IQR (CV) : 101.5 (-1.8) 99 distinct values 886 (87.5%) 127 (12.5%)
31 st_act_3 [numeric] Mean (sd) : -30.9 (47.6) min < med < max: -99 < 0.7 < 21.4 IQR (CV) : 100.5 (-1.5) 92 distinct values 886 (87.5%) 127 (12.5%)
32 st_act_wknd_1 [numeric] Min : 3 Mean : 3.5 Max : 4
3:336(49.3%)
4:346(50.7%)
682 (67.3%) 331 (32.7%)
33 st_act_wknd_2 [numeric] Min : 3 Mean : 3.5 Max : 4
3:297(46.3%)
4:344(53.7%)
641 (63.3%) 372 (36.7%)
34 st_act_wknd_3 [numeric] Min : 3 Mean : 3.5 Max : 4
3:304(50.8%)
4:294(49.2%)
598 (59.0%) 415 (41.0%)
35 sa_wknd_time_1 [numeric] Mean (sd) : -0.7 (20.3) min < med < max: -99 < 2.5 < 13.3 IQR (CV) : 2.3 (-27.4) 83 distinct values 347 (34.3%) 666 (65.7%)
36 sa_wknd_time_2 [numeric] Mean (sd) : 2.2 (12.8) min < med < max: -99 < 2.2 < 19 IQR (CV) : 3.7 (5.8) 97 distinct values 344 (34.0%) 669 (66.0%)
37 sa_wknd_time_3 [numeric] Mean (sd) : -13.8 (37.7) min < med < max: -99 < 1 < 16.4 IQR (CV) : 2.8 (-2.7) 73 distinct values 296 (29.2%) 717 (70.8%)
38 st_act_covid_1 [numeric] Mean (sd) : 3.6 (1.5) min < med < max: 1 < 3 < 6 IQR (CV) : 2 (0.4)
1:44(5.0%)
2:158(17.9%)
3:307(34.7%)
4:139(15.7%)
5:83(9.4%)
6:153(17.3%)
884 (87.3%) 129 (12.7%)
39 st_act_covid_2 [numeric] Mean (sd) : 3.7 (1.4) min < med < max: 1 < 3 < 6 IQR (CV) : 2 (0.4)
1:30(3.4%)
2:144(16.3%)
3:287(32.5%)
4:182(20.6%)
5:79(8.9%)
6:162(18.3%)
884 (87.3%) 129 (12.7%)
40 st_act_covid_3 [numeric] Mean (sd) : 3.5 (1.7) min < med < max: 1 < 3 < 6 IQR (CV) : 3 (0.5)
1:114(12.9%)
2:129(14.6%)
3:294(33.3%)
4:106(12.0%)
5:41(4.6%)
6:200(22.6%)
884 (87.3%) 129 (12.7%)
41 own_device [numeric] Mean (sd) : 2.7 (0.7) min < med < max: 1 < 3 < 4 IQR (CV) : 0 (0.2)
1:97(11.0%)
2:51(5.8%)
3:719(81.3%)
4:17(1.9%)
884 (87.3%) 129 (12.7%)
42 dev_act_1 [numeric] Mean (sd) : -2 (22.1) min < med < max: -99 < 2 < 16.8 IQR (CV) : 2.5 (-11.1) 110 distinct values 861 (85.0%) 152 (15.0%)
43 dev_act_7 [numeric] Mean (sd) : -0.2 (18.3) min < med < max: -99 < 2 < 18.6 IQR (CV) : 2.9 (-80.3) 109 distinct values 861 (85.0%) 152 (15.0%)
44 dev_act_3 [numeric] Mean (sd) : -13.2 (35.9) min < med < max: -99 < 1 < 20.8 IQR (CV) : 1.2 (-2.7) 84 distinct values 861 (85.0%) 152 (15.0%)
45 dev_act_6 [numeric] Mean (sd) : -11.1 (34.6) min < med < max: -99 < 1.3 < 20.9 IQR (CV) : 2.2 (-3.1) 102 distinct values 861 (85.0%) 152 (15.0%)
46 dev_act_wknd_1 [numeric] Min : 2 Mean : 2.4 Max : 3
2:466(56.9%)
3:353(43.1%)
819 (80.8%) 194 (19.2%)
47 dev_act_wknd_2 [numeric] Min : 2 Mean : 2.4 Max : 3
2:484(58.1%)
3:349(41.9%)
833 (82.2%) 180 (17.8%)
48 dev_act_wknd_3 [numeric] Min : 2 Mean : 2.5 Max : 3
2:339(46.2%)
3:395(53.8%)
734 (72.5%) 279 (27.5%)
49 dev_act_wknd_4 [numeric] Min : 2 Mean : 2.4 Max : 3
2:460(61.5%)
3:288(38.5%)
748 (73.8%) 265 (26.2%)
50 da_wknd_time_1 [numeric] Mean (sd) : 3.3 (5.1) min < med < max: -99 < 3 < 11.6 IQR (CV) : 1.9 (1.6) 83 distinct values 465 (45.9%) 548 (54.1%)
51 da_wknd_time_2 [numeric] Mean (sd) : 3.4 (5.4) min < med < max: -99 < 2.9 < 17.8 IQR (CV) : 2.5 (1.6) 102 distinct values 483 (47.7%) 530 (52.3%)
52 da_wknd_time_3 [numeric] Mean (sd) : 1.5 (11.3) min < med < max: -99 < 1.9 < 20.3 IQR (CV) : 2.1 (7.6) 81 distinct values 339 (33.5%) 674 (66.5%)
53 da_wknd_time_6 [numeric] Mean (sd) : 2.2 (12) min < med < max: -99 < 2.7 < 18 IQR (CV) : 2.4 (5.4) 99 distinct values 459 (45.3%) 554 (54.7%)
54 dev_act_covid_1 [numeric] Mean (sd) : 3.7 (1) min < med < max: 1 < 4 < 6 IQR (CV) : 1 (0.3)
1:25(2.9%)
2:65(7.6%)
3:287(33.5%)
4:297(34.7%)
5:168(19.6%)
6:14(1.6%)
856 (84.5%) 157 (15.5%)
55 dev_act_covid_2 [numeric] Mean (sd) : 3.5 (1) min < med < max: 1 < 4 < 6 IQR (CV) : 1 (0.3)
1:13(1.5%)
2:118(13.8%)
3:269(31.4%)
4:311(36.3%)
5:136(15.9%)
6:9(1.1%)
856 (84.5%) 157 (15.5%)
56 dev_act_covid_3 [numeric] Mean (sd) : 3.5 (1) min < med < max: 1 < 3 < 6 IQR (CV) : 1 (0.3)
1:18(2.1%)
2:93(10.9%)
3:362(42.3%)
4:249(29.1%)
5:109(12.7%)
6:25(2.9%)
856 (84.5%) 157 (15.5%)
57 dev_act_covid_4 [numeric] Mean (sd) : 3.6 (0.9) min < med < max: 1 < 4 < 6 IQR (CV) : 1 (0.3)
1:9(1.1%)
2:69(8.1%)
3:348(40.7%)
4:294(34.3%)
5:130(15.2%)
6:6(0.7%)
856 (84.5%) 157 (15.5%)
58 dev_act_covid_5 [numeric] Mean (sd) : 3.6 (0.9) min < med < max: 1 < 4 < 6 IQR (CV) : 1 (0.2)
1:12(1.4%)
2:56(6.5%)
3:314(36.7%)
4:323(37.7%)
5:145(16.9%)
6:6(0.7%)
856 (84.5%) 157 (15.5%)
59 dev_act_covid_6 [numeric] Mean (sd) : 3.5 (0.9) min < med < max: 1 < 3 < 6 IQR (CV) : 1 (0.3)
1:9(1.1%)
2:88(10.3%)
3:352(41.1%)
4:274(32.0%)
5:124(14.5%)
6:9(1.1%)
856 (84.5%) 157 (15.5%)
60 dev_act_covid_7 [numeric] Mean (sd) : 3.8 (1) min < med < max: 1 < 4 < 6 IQR (CV) : 1 (0.3)
1:16(1.9%)
2:52(6.1%)
3:252(29.4%)
4:333(38.9%)
5:162(18.9%)
6:41(4.8%)
856 (84.5%) 157 (15.5%)
61 other_act_1 [numeric] Mean (sd) : -11.7 (35.7) min < med < max: -99 < 1.4 < 18.4 IQR (CV) : 2.4 (-3) 104 distinct values 871 (86.0%) 142 (14.0%)
62 other_act_2 [numeric] Mean (sd) : -2.8 (21.2) min < med < max: -99 < 1.1 < 15 IQR (CV) : 1.3 (-7.5) 81 distinct values 871 (86.0%) 142 (14.0%)
63 other_act_3 [numeric] Mean (sd) : -2.6 (20.4) min < med < max: -99 < 1.1 < 20.9 IQR (CV) : 1.1 (-8) 81 distinct values 871 (86.0%) 142 (14.0%)
64 other_act_4 [numeric] Mean (sd) : -24.1 (44.1) min < med < max: -99 < 0.7 < 16.8 IQR (CV) : 100.5 (-1.8) 84 distinct values 871 (86.0%) 142 (14.0%)
65 other_act_wknd_1 [numeric] Min : 2 Mean : 2.6 Max : 3
2:313(41.8%)
3:435(58.2%)
748 (73.8%) 265 (26.2%)
66 other_act_wknd_2 [numeric] Min : 2 Mean : 2.4 Max : 3
2:481(57.8%)
3:351(42.2%)
832 (82.1%) 181 (17.9%)
67 other_act_wknd_3 [numeric] Min : 2 Mean : 2.5 Max : 3
2:398(47.7%)
3:437(52.3%)
835 (82.4%) 178 (17.6%)
68 other_act_wknd_4 [numeric] Min : 2 Mean : 2.5 Max : 3
2:316(48.5%)
3:335(51.5%)
651 (64.3%) 362 (35.7%)
69 oa_wknd_time_1 [numeric] Mean (sd) : 2.8 (7.9) min < med < max: -99 < 2.4 < 17.8 IQR (CV) : 2.5 (2.8) 102 distinct values 575 (56.8%) 438 (43.2%)
70 oa_wknd_time_2 [numeric] Mean (sd) : 1.6 (9.4) min < med < max: -99 < 2 < 22.2 IQR (CV) : 1.4 (5.9) 83 distinct values 614 (60.6%) 399 (39.4%)
71 oa_wknd_time_3 [numeric] Mean (sd) : 1.3 (9.4) min < med < max: -99 < 1.5 < 18.8 IQR (CV) : 1.3 (7.2) 82 distinct values 617 (60.9%) 396 (39.1%)
72 oa_wknd_time_4 [numeric] Mean (sd) : 0 (14.4) min < med < max: -99 < 1.2 < 20.6 IQR (CV) : 1.5 (-1026) 79 distinct values 500 (49.4%) 513 (50.6%)
73 other_act_covid_1 [numeric] Mean (sd) : 3.5 (1) min < med < max: 1 < 3 < 6 IQR (CV) : 1 (0.3)
1:26(3.0%)
2:72(8.3%)
3:394(45.4%)
4:223(25.7%)
5:128(14.8%)
6:24(2.8%)
867 (85.6%) 146 (14.4%)
74 other_act_covid_2 [numeric] Mean (sd) : 3.6 (1) min < med < max: 1 < 4 < 6 IQR (CV) : 1 (0.3)
1:12(1.4%)
2:82(9.5%)
3:321(37.0%)
4:291(33.6%)
5:152(17.5%)
6:9(1.0%)
867 (85.6%) 146 (14.4%)
75 other_act_covid_3 [numeric] Mean (sd) : 3.5 (0.9) min < med < max: 1 < 3 < 6 IQR (CV) : 1 (0.3)
1:12(1.4%)
2:72(8.3%)
3:379(43.7%)
4:260(30.0%)
5:130(15.0%)
6:14(1.6%)
867 (85.6%) 146 (14.4%)
76 other_act_covid_4 [numeric] Mean (sd) : 3.5 (1.1) min < med < max: 1 < 3 < 6 IQR (CV) : 1 (0.3)
1:27(3.1%)
2:75(8.7%)
3:395(45.6%)
4:236(27.2%)
5:76(8.8%)
6:58(6.7%)
867 (85.6%) 146 (14.4%)
77 pre_electric [numeric] Mean (sd) : 169.6 (456.9) min < med < max: 1 < 100 < 9000 IQR (CV) : 80 (2.7) 107 distinct values 864 (85.3%) 149 (14.7%)
78 post_electric [numeric] Mean (sd) : 167 (280.3) min < med < max: 2 < 110 < 4000 IQR (CV) : 92.5 (1.7) 106 distinct values 863 (85.2%) 150 (14.8%)
79 pre_gas [numeric] Mean (sd) : 214.2 (471.8) min < med < max: 0 < 80 < 8000 IQR (CV) : 150 (2.2) 100 distinct values 861 (85.0%) 152 (15.0%)
80 post_gas [numeric] Mean (sd) : 172 (497.4) min < med < max: 0 < 80 < 9000 IQR (CV) : 70 (2.9) 98 distinct values 859 (84.8%) 154 (15.2%)
81 num_vehicles [numeric] Mean (sd) : 1.5 (0.9) min < med < max: 0 < 1 < 20 IQR (CV) : 1 (0.6)
0:26(3.0%)
1:471(54.8%)
2:329(38.3%)
3:30(3.5%)
4:1(0.1%)
5:1(0.1%)
20:1(0.1%)
859 (84.8%) 154 (15.2%)
82 pre_trans [numeric] Mean (sd) : 374.3 (587.3) min < med < max: 0 < 210 < 9000 IQR (CV) : 280 (1.6) 94 distinct values 857 (84.6%) 156 (15.4%)
83 post_trans [numeric] Mean (sd) : 215.9 (611.6) min < med < max: 0 < 100 < 8080 IQR (CV) : 100 (2.8) 92 distinct values 857 (84.6%) 156 (15.4%)
84 health [numeric] Mean (sd) : 2.3 (0.9) min < med < max: 1 < 2 < 5 IQR (CV) : 1 (0.4)
1:141(16.5%)
2:339(39.6%)
3:324(37.9%)
4:42(4.9%)
5:10(1.2%)
856 (84.5%) 157 (15.5%)
85 mental_health_anxious [numeric] Mean (sd) : 0 (14.6) min < med < max: -99 < 2 < 4 IQR (CV) : 2 (-1244.3)
-99:18(2.1%)
1:248(29.0%)
2:308(36.0%)
3:216(25.3%)
4:65(7.6%)
855 (84.4%) 158 (15.6%)
86 mental_health_worry [numeric] Mean (sd) : -0.9 (16.7) min < med < max: -99 < 2 < 4 IQR (CV) : 2 (-19.6)
-99:24(2.8%)
1:328(38.4%)
2:247(28.9%)
3:201(23.5%)
4:55(6.4%)
855 (84.4%) 158 (15.6%)
87 mental_health_interest [numeric] Mean (sd) : -0.2 (15.3) min < med < max: -99 < 2 < 4 IQR (CV) : 2 (-66.2)
-99:20(2.3%)
1:230(26.9%)
2:325(38.0%)
3:218(25.5%)
4:62(7.3%)
855 (84.4%) 158 (15.6%)
88 mental_health_down [numeric] Mean (sd) : -1.1 (17.4) min < med < max: -99 < 2 < 4 IQR (CV) : 2 (-16.4)
-99:26(3.0%)
1:323(37.8%)
2:231(27.0%)
3:216(25.3%)
4:59(6.9%)
855 (84.4%) 158 (15.6%)
89 physical_health [numeric] Mean (sd) : 3 (3.4) min < med < max: 0 < 2 < 28 IQR (CV) : 5 (1.1) 17 distinct values 854 (84.3%) 159 (15.7%)
90 mental_health [numeric] Mean (sd) : 3.9 (4.8) min < med < max: 0 < 2 < 30 IQR (CV) : 5 (1.2) 23 distinct values 853 (84.2%) 160 (15.8%)
91 pre_phy_health [numeric] Mean (sd) : 1.6 (7.7) min < med < max: -99 < 2 < 3 IQR (CV) : 1 (4.9)
-99:5(0.6%)
1:76(8.9%)
2:554(64.9%)
3:218(25.6%)
853 (84.2%) 160 (15.8%)
92 pre_mental_health [numeric] Mean (sd) : 1.4 (7.7) min < med < max: -99 < 2 < 3 IQR (CV) : 0 (5.3)
-99:5(0.6%)
1:170(19.9%)
2:473(55.5%)
3:205(24.0%)
853 (84.2%) 160 (15.8%)
93 days_poor_health [numeric] Mean (sd) : 3.1 (4.4) min < med < max: 0 < 2 < 25 IQR (CV) : 4 (1.4) 22 distinct values 853 (84.2%) 160 (15.8%)
94 impairment [numeric] Mean (sd) : -3.4 (22) min < med < max: -99 < 2 < 2 IQR (CV) : 1 (-6.4)
-99:43(5.0%)
1:285(33.4%)
2:525(61.5%)
853 (84.2%) 160 (15.8%)
95 impairment_hsh...103 [numeric] Mean (sd) : -5 (24.9) min < med < max: -99 < 2 < 2 IQR (CV) : 1 (-5)
-99:56(6.6%)
1:273(32.0%)
2:524(61.4%)
853 (84.2%) 160 (15.8%)
96 num_hsh_impair [numeric] Mean (sd) : 0.6 (1) min < med < max: 0 < 0 < 12 IQR (CV) : 1 (1.7)
0:517(60.6%)
1:212(24.9%)
2:100(11.7%)
3:11(1.3%)
4:7(0.8%)
5:1(0.1%)
6:3(0.4%)
10:1(0.1%)
12:1(0.1%)
853 (84.2%) 160 (15.8%)
97 major_impairment [numeric] Mean (sd) : -7.1 (38) min < med < max: -99 < 7 < 14 IQR (CV) : 11 (-5.3) 15 distinct values 284 (28.0%) 729 (72.0%)
98 other_major_imp [numeric] 1 distinct value
0:1(100.0%)
1 (0.1%) 1012 (99.9%)
99 impairment_hsh...107 [numeric] Mean (sd) : -8 (38.7) min < med < max: -99 < 7 < 14 IQR (CV) : 11 (-4.9) 15 distinct values 271 (26.8%) 742 (73.2%)
100 other_impairment_hsh [character] 1. A mild cold mak
1(100.0%)
1 (0.1%) 1012 (99.9%)
101 days_impairment_1 [numeric] Mean (sd) : -30.8 (50.8) min < med < max: -99 < 2 < 31 IQR (CV) : 106 (-1.6) 26 distinct values 851 (84.0%) 162 (16.0%)
102 weeks_impairment_4 [numeric] Mean (sd) : -52.9 (50.2) min < med < max: -99 < -99 < 7 IQR (CV) : 100 (-1)
-99:461(54.2%)
0:63(7.4%)
1:153(18.0%)
2:84(9.9%)
3:48(5.6%)
4:25(2.9%)
5:9(1.1%)
6:4(0.5%)
7:4(0.5%)
851 (84.0%) 162 (16.0%)
103 months_impairment_1 [numeric] Mean (sd) : -60.1 (49.2) min < med < max: -99 < -99 < 10 IQR (CV) : 100 (-0.8) 12 distinct values 851 (84.0%) 162 (16.0%)
104 years_impairment_1 [numeric] Mean (sd) : -63.1 (48.2) min < med < max: -99 < -99 < 7 IQR (CV) : 99 (-0.8)
-99:547(64.3%)
0:95(11.2%)
1:99(11.6%)
2:58(6.8%)
3:21(2.5%)
4:15(1.8%)
5:9(1.1%)
6:3(0.4%)
7:4(0.5%)
851 (84.0%) 162 (16.0%)
105 med_device_1 [numeric] Mean (sd) : -51.1 (49.7) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:253(29.7%)
1:157(18.4%)
851 (84.0%) 162 (16.0%)
106 med_device_2 [numeric] Mean (sd) : -51.2 (49.6) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:338(39.7%)
1:72(8.5%)
851 (84.0%) 162 (16.0%)
107 med_device_3 [numeric] Mean (sd) : -51.2 (49.6) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:350(41.1%)
1:60(7.1%)
851 (84.0%) 162 (16.0%)
108 med_device_4 [numeric] Mean (sd) : -51.2 (49.6) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:364(42.8%)
1:46(5.4%)
851 (84.0%) 162 (16.0%)
109 med_device_5 [numeric] Mean (sd) : -51.2 (49.6) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:308(36.2%)
1:102(12.0%)
851 (84.0%) 162 (16.0%)
110 med_device_6 [numeric] Mean (sd) : -51.3 (49.5) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:406(47.7%)
1:4(0.5%)
851 (84.0%) 162 (16.0%)
111 med_device_7 [numeric] Mean (sd) : -51.2 (49.6) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:313(36.8%)
1:97(11.4%)
851 (84.0%) 162 (16.0%)
112 med_device_8 [numeric] Mean (sd) : -51.2 (49.6) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:311(36.5%)
1:99(11.6%)
851 (84.0%) 162 (16.0%)
113 med_device_9 [numeric] Mean (sd) : -51.2 (49.6) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:361(42.4%)
1:49(5.8%)
851 (84.0%) 162 (16.0%)
114 med_device_10 [numeric] Mean (sd) : -51.3 (49.5) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:379(44.5%)
1:31(3.6%)
851 (84.0%) 162 (16.0%)
115 med_device_11 [numeric] Mean (sd) : -51.3 (49.5) min < med < max: -99 < -99 < 1 IQR (CV) : 99 (-1)
-99:441(51.8%)
0:401(47.1%)
1:9(1.1%)
851 (84.0%) 162 (16.0%)
116 other_med_device [character] 1. 0 2. glasses 3. Hh 4. no 5. No 6. Portable sleep 7. ventilator / re
2(25.0%)
1(12.5%)
1(12.5%)
1(12.5%)
1(12.5%)
1(12.5%)
1(12.5%)
8 (0.8%) 1005 (99.2%)
117 emp_status [numeric] Mean (sd) : 1.8 (1.5) min < med < max: 1 < 1 < 7 IQR (CV) : 1.8 (0.8)
1:599(70.5%)
2:38(4.5%)
3:71(8.4%)
4:95(11.2%)
5:3(0.4%)
6:19(2.2%)
7:25(2.9%)
850 (83.9%) 163 (16.1%)
118 emp_status_partner [numeric] Mean (sd) : 2.2 (1.8) min < med < max: 1 < 1 < 7 IQR (CV) : 2 (0.8)
1:515(60.6%)
2:52(6.1%)
3:80(9.4%)
4:125(14.7%)
5:5(0.6%)
6:15(1.8%)
7:58(6.8%)
850 (83.9%) 163 (16.1%)
119 work_home [numeric] Mean (sd) : 0.3 (17.3) min < med < max: -99 < 3 < 4 IQR (CV) : 1 (58.1)
-99:25(2.9%)
3:568(66.9%)
4:256(30.2%)
849 (83.8%) 164 (16.2%)
120 work_home_partner [numeric] Mean (sd) : -7.3 (28.2) min < med < max: -99 < 1 < 2 IQR (CV) : 1 (-3.9)
-99:73(8.6%)
1:489(57.6%)
2:287(33.8%)
849 (83.8%) 164 (16.2%)
121 frontline [numeric] Mean (sd) : -0.9 (15.6) min < med < max: -99 < 2 < 2 IQR (CV) : 1 (-17.5)
-99:21(2.5%)
1:336(39.6%)
2:492(58.0%)
849 (83.8%) 164 (16.2%)
122 frontline_partner [numeric] Mean (sd) : -6.6 (27.5) min < med < max: -99 < 2 < 2 IQR (CV) : 1 (-4.2)
-99:69(8.1%)
1:306(36.0%)
2:474(55.8%)
849 (83.8%) 164 (16.2%)
123 hrs_work_3 [numeric] Mean (sd) : 31.8 (29.8) min < med < max: -99 < 39 < 74 IQR (CV) : 10 (0.9) 69 distinct values 848 (83.7%) 165 (16.3%)
124 hrs_work_4 [numeric] Mean (sd) : -35 (61.4) min < med < max: -99 < 0 < 80 IQR (CV) : 119 (-1.8) 65 distinct values 848 (83.7%) 165 (16.3%)
125 hrs_work_partner_3 [numeric] Mean (sd) : 18 (46.3) min < med < max: -99 < 35 < 80 IQR (CV) : 16 (2.6) 74 distinct values 848 (83.7%) 165 (16.3%)
126 hrs_work_partner_4 [numeric] Mean (sd) : -41.3 (61.9) min < med < max: -99 < -99 < 80 IQR (CV) : 116 (-1.5) 68 distinct values 848 (83.7%) 165 (16.3%)
127 min_commute_3 [numeric] Mean (sd) : 11.8 (43.5) min < med < max: -99 < 25 < 60 IQR (CV) : 20 (3.7) 59 distinct values 847 (83.6%) 166 (16.4%)
128 hrs_commute_3 [numeric] Mean (sd) : -42.7 (49.5) min < med < max: -99 < 0 < 4 IQR (CV) : 100 (-1.2)
-99:369(43.6%)
0:169(20.0%)
1:240(28.3%)
2:55(6.5%)
3:12(1.4%)
4:2(0.2%)
847 (83.6%) 166 (16.4%)
129 min_commute_partner_3 [numeric] Mean (sd) : -0.3 (53.4) min < med < max: -99 < 21 < 60 IQR (CV) : 28.5 (-191.6) 56 distinct values 847 (83.6%) 166 (16.4%)
130 hrs_commute_partnet_3 [numeric] Mean (sd) : -49.5 (50) min < med < max: -99 < -99 < 4 IQR (CV) : 100 (-1)
-99:427(50.4%)
0:136(16.1%)
1:214(25.3%)
2:52(6.1%)
3:15(1.8%)
4:3(0.4%)
847 (83.6%) 166 (16.4%)
131 rsn_nowork [numeric] Mean (sd) : -5.4 (27.8) min < med < max: -99 < 3 < 4 IQR (CV) : 1 (-5.1)
-99:20(8.1%)
1:8(3.2%)
2:50(20.2%)
3:144(58.3%)
4:25(10.1%)
247 (24.4%) 766 (75.6%)
132 rsn_nowork_partner [numeric] Mean (sd) : -15.8 (39.4) min < med < max: -99 < 3 < 4 IQR (CV) : 1 (-2.5)
-99:60(18.3%)
1:5(1.5%)
2:76(23.2%)
3:154(47.0%)
4:33(10.1%)
328 (32.4%) 685 (67.6%)
133 eip_1 [numeric] Mean (sd) : -4.3 (21.4) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-5)
-99:41(4.8%)
0:389(46.0%)
1:416(49.2%)
846 (83.5%) 167 (16.5%)
134 eip_2 [numeric] Mean (sd) : -4.3 (21.4) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-5)
-99:41(4.8%)
0:388(45.9%)
1:417(49.3%)
846 (83.5%) 167 (16.5%)
135 eip_3 [numeric] Mean (sd) : -4.5 (21.3) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-4.7)
-99:41(4.8%)
0:591(69.9%)
1:214(25.3%)
846 (83.5%) 167 (16.5%)
136 eip_4 [numeric] Mean (sd) : -4.4 (21.4) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-4.9)
-99:41(4.8%)
0:451(53.3%)
1:354(41.8%)
846 (83.5%) 167 (16.5%)
137 eip_5 [numeric] Mean (sd) : -4.4 (21.4) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-4.8)
-99:41(4.8%)
0:478(56.5%)
1:327(38.7%)
846 (83.5%) 167 (16.5%)
138 eip_6 [numeric] Mean (sd) : -4.8 (21.3) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-4.4)
-99:41(4.8%)
0:794(93.9%)
1:11(1.3%)
846 (83.5%) 167 (16.5%)
139 eip_7 [numeric] Mean (sd) : -4.8 (21.3) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-4.4)
-99:41(4.8%)
0:792(93.6%)
1:13(1.5%)
846 (83.5%) 167 (16.5%)
140 other_eip [character] 1. 会 2. 0 3. 1 4. 1989 5. 200 6. 5000 7. Courses in hear 8. hui 9. no 10. shopping
1(9.1%)
1(9.1%)
1(9.1%)
1(9.1%)
1(9.1%)
1(9.1%)
1(9.1%)
1(9.1%)
2(18.2%)
1(9.1%)
11 (1.1%) 1002 (98.9%)
141 year [numeric] Mean (sd) : 17.5 (7) min < med < max: 1 < 17 < 63 IQR (CV) : 8 (0.4) 42 distinct values 846 (83.5%) 167 (16.5%)
142 gender [numeric] Mean (sd) : 1.7 (0.6) min < med < max: 1 < 2 < 6 IQR (CV) : 1 (0.3)
1:286(33.8%)
2:550(65.1%)
3:2(0.2%)
4:2(0.2%)
6:5(0.6%)
845 (83.4%) 168 (16.6%)
143 gender_7_TEXT [numeric] 1 distinct value
-99:845(100.0%)
845 (83.4%) 168 (16.6%)
144 hispanic [numeric] Mean (sd) : 1.5 (0.5) min < med < max: 1 < 1 < 3 IQR (CV) : 1 (0.4)
1:425(50.4%)
2:404(47.9%)
3:15(1.8%)
844 (83.3%) 169 (16.7%)
145 race [numeric] Mean (sd) : 1.4 (1) min < med < max: 1 < 1 < 8 IQR (CV) : 0 (0.7)
1:681(80.7%)
2:91(10.8%)
3:14(1.7%)
4:42(5.0%)
5:6(0.7%)
6:5(0.6%)
7:1(0.1%)
8:4(0.5%)
844 (83.3%) 169 (16.7%)
146 education [numeric] Mean (sd) : 4.1 (6.3) min < med < max: -99 < 4 < 7 IQR (CV) : 3 (1.5)
-99:3(0.4%)
1:10(1.2%)
2:43(5.1%)
3:183(21.7%)
4:216(25.6%)
5:144(17.1%)
6:199(23.6%)
7:46(5.5%)
844 (83.3%) 169 (16.7%)
147 marital [numeric] Mean (sd) : 2 (0.6) min < med < max: 1 < 2 < 6 IQR (CV) : 0 (0.3)
1:78(9.2%)
2:695(82.3%)
3:55(6.5%)
4:4(0.5%)
5:4(0.5%)
6:8(0.9%)
844 (83.3%) 169 (16.7%)
148 depen [numeric] Min : 1 Mean : 1.2 Max : 2
1:650(77.0%)
2:194(23.0%)
844 (83.3%) 169 (16.7%)
149 num_hsh [numeric] Mean (sd) : 3.7 (1.6) min < med < max: 0 < 4 < 10 IQR (CV) : 2 (0.4) 11 distinct values 844 (83.3%) 169 (16.7%)
150 num_children [numeric] Mean (sd) : 1.2 (1.7) min < med < max: 0 < 1 < 18 IQR (CV) : 0 (1.4) 11 distinct values 844 (83.3%) 169 (16.7%)
151 num_retired [numeric] Mean (sd) : 0.7 (0.9) min < med < max: 0 < 0 < 6 IQR (CV) : 1 (1.2)
0:447(53.0%)
1:196(23.2%)
2:189(22.4%)
3:4(0.5%)
4:5(0.6%)
5:2(0.2%)
6:1(0.1%)
844 (83.3%) 169 (16.7%)
152 num_rooms [numeric] Mean (sd) : 4.4 (1.8) min < med < max: 0 < 4 < 22 IQR (CV) : 2 (0.4) 12 distinct values 844 (83.3%) 169 (16.7%)
153 num_bedrooms [numeric] Mean (sd) : 2.9 (1) min < med < max: 1 < 3 < 9 IQR (CV) : 1 (0.3)
1:42(5.0%)
2:237(28.1%)
3:359(42.6%)
4:145(17.2%)
5:49(5.8%)
6:8(1.0%)
7:1(0.1%)
9:1(0.1%)
842 (83.1%) 171 (16.9%)
154 sq_ft [numeric] Mean (sd) : 5.3 (2.8) min < med < max: 1 < 5 < 13 IQR (CV) : 4 (0.5) 13 distinct values 844 (83.3%) 169 (16.7%)
155 hardships_1 [numeric] Mean (sd) : -11.4 (32.5) min < med < max: -99 < 1 < 1 IQR (CV) : 1 (-2.9)
-99:102(12.1%)
0:250(29.6%)
1:492(58.3%)
844 (83.3%) 169 (16.7%)
156 hardships_2 [numeric] Mean (sd) : -11.8 (32.4) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-2.7)
-99:102(12.1%)
0:587(69.5%)
1:155(18.4%)
844 (83.3%) 169 (16.7%)
157 hardships_3 [numeric] Mean (sd) : -11.7 (32.4) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-2.8)
-99:102(12.1%)
0:539(63.9%)
1:203(24.1%)
844 (83.3%) 169 (16.7%)
158 hardships_4 [numeric] Mean (sd) : -11.7 (32.4) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-2.8)
-99:102(12.1%)
0:532(63.0%)
1:210(24.9%)
844 (83.3%) 169 (16.7%)
159 hardships_5 [numeric] Mean (sd) : -11.8 (32.3) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-2.7)
-99:102(12.1%)
0:610(72.3%)
1:132(15.6%)
844 (83.3%) 169 (16.7%)
160 hardships_6 [numeric] Mean (sd) : -11.9 (32.3) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-2.7)
-99:102(12.1%)
0:669(79.3%)
1:73(8.6%)
844 (83.3%) 169 (16.7%)
161 welfare_1 [numeric] Mean (sd) : -9.2 (29.3) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-3.2)
-99:81(9.6%)
0:470(55.7%)
1:293(34.7%)
844 (83.3%) 169 (16.7%)
162 welfare_2 [numeric] Mean (sd) : -9.2 (29.3) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-3.2)
-99:81(9.6%)
0:509(60.3%)
1:254(30.1%)
844 (83.3%) 169 (16.7%)
163 welfare_3 [numeric] Mean (sd) : -9.4 (29.2) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-3.1)
-99:81(9.6%)
0:644(76.3%)
1:119(14.1%)
844 (83.3%) 169 (16.7%)
164 welfare_4 [numeric] Mean (sd) : -9.1 (29.3) min < med < max: -99 < 0 < 1 IQR (CV) : 1 (-3.2)
-99:81(9.6%)
0:410(48.6%)
1:353(41.8%)
844 (83.3%) 169 (16.7%)
165 welfare_5 [numeric] Mean (sd) : -9.3 (29.2) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-3.1)
-99:81(9.6%)
0:589(69.8%)
1:174(20.6%)
844 (83.3%) 169 (16.7%)
166 welfare_6 [numeric] Mean (sd) : -9.4 (29.2) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-3.1)
-99:81(9.6%)
0:673(79.7%)
1:90(10.7%)
844 (83.3%) 169 (16.7%)
167 welfare_7 [numeric] Mean (sd) : -9.4 (29.2) min < med < max: -99 < 0 < 1 IQR (CV) : 0 (-3.1)
-99:81(9.6%)
0:675(80.0%)
1:88(10.4%)
844 (83.3%) 169 (16.7%)
168 email [character] Emails Valid Invalid Duplicates
839(99.9%)
1(0.1%)
34(4.0%)
840 (82.9%) 173 (17.1%)
169 email_confirm [numeric] 1 distinct value
1:840(100.0%)
840 (82.9%) 173 (17.1%)

Generated by summarytools 0.9.8 (R version 4.0.4)
2021-03-23

Part II.

Which responses to keep?

  1. Consider odd response those outside the “normal” range of duration (1.36, 71) AND above 91 NA values
  2. Summary table: responses that Agree to participate, valid zip code (78202 or 78230), not an odd response
### Duration and number of NAs
kable(table(san$nas_out, san$duration_min_out), caption = "NAs (%) vs Duration (min)") %>% 
  kable_classic(full_width = F) %>% 
  footnote(general = "NAs in (10%, 90%); duration in (2.5%, 97.5%)")
NAs (%) vs Duration (min)
Spend too much time Normal Spend too little time
Above 85% quantile 8 111 33
Normal 15 672 0
Below 10% quantile 3 171 0
Note:
NAs in (10%, 90%); duration in (2.5%, 97.5%)
kable(table(san$nas_out, san$duration_min_out2), caption = "NAs (%) vs Duration (min)") %>% 
  kable_classic(full_width = F) %>% 
  footnote(general = "NAs in (10%, 90%); duration in (5%, 95%)")  
NAs (%) vs Duration (min)
Above 95% quantile Normal Below 5% quantile
Above 85% quantile 10 91 51
Normal 37 650 0
Below 10% quantile 4 170 0
Note:
NAs in (10%, 90%); duration in (5%, 95%)
kable(table(san$odd_r2), caption = "Odd responses") %>% 
  kable_classic(full_width = F)
Odd responses
Var1 Freq
Normal 952
Odd response 61
san2 <- san %>% 
  # consent Agree and double check on survey participation. Keep zip code 78202 or 78230. Keep the first answer for unique emails
  filter(consent == "1" | disagree == "1", zipcode != 3, odd_r2 == "Normal") %>% 
  mutate(zipcode = if_else(zipcode == "1", "Elm Creek", 
                           if_else(zipcode == "2", "Jefferson Heights", NA_character_)),
         rep_email = if_else(email == lag(email, n = 1, order_by = email), "rep_email", "first_entry")) %>% 
  # Keep only the first response for those repeated emails 
  filter(rep_email == "first_entry")

#view(dfSummary(san2[, 5:173], plain.ascii = F, graph.magnif = .75, labels.col = T, max.string.width = 15), method = "render")

Section IV. Background Characteristics by Zip code

san2 %>%
  select(16, 146, 148:171, 175, 178:189) %>% 
  tbl_summary(by = zipcode, 
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>% 
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section IV. Background characteristics (N = {N})**") %>% 
  bold_labels()
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
gender 805 >0.9
1 164 (34%) 112 (34%)
2 310 (65%) 210 (64%)
3 1 (0.2%) 1 (0.3%)
4 1 (0.2%) 1 (0.3%)
6 3 (0.6%) 2 (0.6%)
hispanic 805 0.4
1 235 (49%) 174 (53%)
2 234 (49%) 147 (45%)
3 10 (2.1%) 5 (1.5%)
race 805 0.013
1 384 (80%) 263 (81%)
2 58 (12%) 32 (9.8%)
3 9 (1.9%) 4 (1.2%)
4 20 (4.2%) 19 (5.8%)
5 0 (0%) 6 (1.8%)
6 5 (1.0%) 0 (0%)
7 0 (0%) 1 (0.3%)
8 3 (0.6%) 1 (0.3%)
education 805
-99 3 (0.6%) 0 (0%)
1 7 (1.5%) 3 (0.9%)
2 24 (5.0%) 15 (4.6%)
3 108 (23%) 67 (21%)
4 120 (25%) 88 (27%)
5 78 (16%) 59 (18%)
6 118 (25%) 73 (22%)
7 21 (4.4%) 21 (6.4%)
marital 805 0.7
1 46 (9.6%) 30 (9.2%)
2 391 (82%) 269 (83%)
3 31 (6.5%) 22 (6.7%)
4 3 (0.6%) 1 (0.3%)
5 4 (0.8%) 0 (0%)
6 4 (0.8%) 4 (1.2%)
depen 805 0.8
1 367 (77%) 247 (76%)
2 112 (23%) 79 (24%)
num_hsh 805 3.7 (1.5) 3.8 (1.6) 0.6
num_children 805 1.2 (1.5) 1.3 (2.1) 0.5
num_retired 805 0.050
0 277 (58%) 159 (49%)
1 108 (23%) 81 (25%)
2 86 (18%) 83 (25%)
3 3 (0.6%) 1 (0.3%)
4 3 (0.6%) 2 (0.6%)
5 2 (0.4%) 0 (0%)
num_rooms 805 4.2 (1.6) 4.5 (1.7) 0.028
num_bedrooms 803 0.6
1 27 (5.7%) 14 (4.3%)
2 137 (29%) 92 (28%)
3 196 (41%) 149 (46%)
4 84 (18%) 50 (15%)
5 29 (6.1%) 16 (4.9%)
6 3 (0.6%) 4 (1.2%)
7 0 (0%) 1 (0.3%)
9 1 (0.2%) 0 (0%)
Unknown 2 0
sq_ft 805 5.2 (2.8) 5.2 (2.7) >0.9
hardships_1 805 0.7
-99 56 (12%) 45 (14%)
0 146 (30%) 96 (29%)
1 277 (58%) 185 (57%)
hardships_2 805 0.6
-99 56 (12%) 45 (14%)
0 335 (70%) 219 (67%)
1 88 (18%) 62 (19%)
hardships_3 805 0.3
-99 56 (12%) 45 (14%)
0 317 (66%) 198 (61%)
1 106 (22%) 83 (25%)
hardships_4 805 0.2
-99 56 (12%) 45 (14%)
0 309 (65%) 191 (59%)
1 114 (24%) 90 (28%)
hardships_5 805 0.6
-99 56 (12%) 45 (14%)
0 349 (73%) 228 (70%)
1 74 (15%) 53 (16%)
hardships_6 805 0.12
-99 56 (12%) 45 (14%)
0 387 (81%) 245 (75%)
1 36 (7.5%) 36 (11%)
welfare_1 805 0.5
-99 52 (11%) 28 (8.6%)
0 275 (57%) 186 (57%)
1 152 (32%) 112 (34%)
welfare_2 805 0.6
-99 52 (11%) 28 (8.6%)
0 282 (59%) 197 (60%)
1 145 (30%) 101 (31%)
welfare_3 805 0.056
-99 52 (11%) 28 (8.6%)
0 373 (78%) 243 (75%)
1 54 (11%) 55 (17%)
welfare_4 805 0.15
-99 52 (11%) 28 (8.6%)
0 237 (49%) 147 (45%)
1 190 (40%) 151 (46%)
welfare_5 805 0.5
-99 52 (11%) 28 (8.6%)
0 327 (68%) 233 (71%)
1 100 (21%) 65 (20%)
welfare_6 805 0.6
-99 52 (11%) 28 (8.6%)
0 374 (78%) 263 (81%)
1 53 (11%) 35 (11%)
welfare_7 805 0.3
-99 52 (11%) 28 (8.6%)
0 371 (77%) 268 (82%)
1 56 (12%) 30 (9.2%)
number_missing_value 805 14.8 (6.6) 15.1 (6.4) 0.4
upper_out 805
97.3399999999999 479 (100%) 326 (100%)
upper_out2 805
71.24 479 (100%) 326 (100%)
lower_out 805
0.7 479 (100%) 326 (100%)
lower_out2 805
1.36 479 (100%) 326 (100%)
na_low 805
5 479 (100%) 326 (100%)
na_upp 805
58.1999999999999 479 (100%) 326 (100%)
duration_min_out 805 0.3
Spend too much time 10 (2.1%) 3 (0.9%)
Normal 469 (98%) 323 (99%)
Spend too little time 0 (0%) 0 (0%)
duration_min_out2 805 0.3
Above 95% quantile 23 (4.8%) 10 (3.1%)
Normal 456 (95%) 316 (97%)
Below 5% quantile 0 (0%) 0 (0%)
nas_out 805 0.9
Above 85% quantile 0 (0%) 0 (0%)
Normal 383 (80%) 259 (79%)
Below 10% quantile 96 (20%) 67 (21%)
odd_r 805
Normal 479 (100%) 326 (100%)
odd_r2 805
Normal 479 (100%) 326 (100%)
rep_email 805
first_entry 479 (100%) 326 (100%)

1 n (%); Mean (SD)

2 Fisher's exact test; Pearson's Chi-squared test; Wilcoxon rank sum test

Section Ia. Time Use by Zip code

san2 %>%
  select(16:80, 175, 178:189) %>% 
  tbl_summary(by = zipcode, 
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>% 
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section Ia. Time Use (N = {N})**") %>% 
  bold_labels()
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
per_care_1 805 8.0 (1.8) 7.9 (1.6) 0.8
per_care_2 805 2.1 (6.9) 2.0 (5.9) 0.045
per_care_3 805 0.0 (14.7) -1.5 (18.3) 0.2
per_care_4 805 0.3 (12.3) -0.1 (13.7) 0.5
per_care_wknd_1 805 0.3
4 216 (45%) 136 (42%)
5 263 (55%) 190 (58%)
per_care_wknd_2 803 0.064
4 251 (53%) 149 (46%)
5 227 (47%) 176 (54%)
Unknown 1 1
per_care_wknd_3 785 0.6
4 260 (55%) 169 (53%)
5 209 (45%) 147 (47%)
Unknown 10 10
per_care_wknd_4 792 0.3
4 290 (61%) 185 (58%)
5 182 (39%) 135 (42%)
Unknown 7 6
pc_wknd_time_1 453 9.1 (2.1) 9.5 (1.9) 0.11
Unknown 216 136
pc_wknd_time_2 403 3.9 (3.1) 3.6 (2.8) 0.3
Unknown 252 150
pc_wknd_time_3 356 2.5 (7.6) 2.4 (2.0) 0.037
Unknown 270 179
pc_wknd_time_4 317 2.4 (2.7) 2.4 (2.7) >0.9
Unknown 297 191
per_care_covid_1 805 0.2
1 22 (4.6%) 8 (2.5%)
2 32 (6.7%) 26 (8.0%)
3 182 (38%) 143 (44%)
4 137 (29%) 88 (27%)
5 106 (22%) 61 (19%)
per_care_covid_2 805 0.5
1 1 (0.2%) 1 (0.3%)
2 50 (10%) 30 (9.2%)
3 226 (47%) 153 (47%)
4 133 (28%) 105 (32%)
5 69 (14%) 37 (11%)
per_care_covid_3 805 >0.9
1 6 (1.3%) 3 (0.9%)
2 37 (7.7%) 23 (7.1%)
3 242 (51%) 165 (51%)
4 124 (26%) 87 (27%)
5 68 (14%) 45 (14%)
6 2 (0.4%) 3 (0.9%)
per_care_covid_4 805 >0.9
1 10 (2.1%) 7 (2.1%)
2 53 (11%) 33 (10%)
3 238 (50%) 172 (53%)
4 128 (27%) 81 (25%)
5 48 (10%) 31 (9.5%)
6 2 (0.4%) 2 (0.6%)
st_act_1 805 -15.9 (42.3) -24.1 (47.1) 0.015
st_act_2 805 -23.8 (44.8) -29.1 (47.3) 0.016
st_act_3 805 -26.3 (45.7) -37.0 (49.4) 0.001
st_act_wknd_1 622 0.4
3 185 (48%) 123 (52%)
4 199 (52%) 115 (48%)
Unknown 95 88
st_act_wknd_2 583 0.4
3 164 (46%) 113 (50%)
4 192 (54%) 114 (50%)
Unknown 123 99
st_act_wknd_3 547 0.2
3 183 (53%) 97 (48%)
4 161 (47%) 106 (52%)
Unknown 135 123
sa_wknd_time_1 315 0.5 (17.7) -3.0 (24.7) 0.3
Unknown 279 211
sa_wknd_time_2 306 3.3 (8.3) 1.5 (13.8) 0.2
Unknown 287 212
sa_wknd_time_3 269 -9.4 (32.9) -18.8 (42.3) 0.9
Unknown 317 219
st_act_covid_1 805 0.15
1 23 (4.8%) 16 (4.9%)
2 94 (20%) 53 (16%)
3 165 (34%) 115 (35%)
4 75 (16%) 46 (14%)
5 50 (10%) 25 (7.7%)
6 72 (15%) 71 (22%)
st_act_covid_2 805 0.001
1 15 (3.1%) 11 (3.4%)
2 86 (18%) 52 (16%)
3 166 (35%) 86 (26%)
4 87 (18%) 86 (26%)
5 48 (10%) 18 (5.5%)
6 77 (16%) 73 (22%)
st_act_covid_3 805 0.007
1 58 (12%) 46 (14%)
2 84 (18%) 40 (12%)
3 167 (35%) 97 (30%)
4 62 (13%) 36 (11%)
5 22 (4.6%) 14 (4.3%)
6 86 (18%) 93 (29%)
own_device 805 0.3
1 49 (10%) 43 (13%)
2 27 (5.6%) 18 (5.5%)
3 394 (82%) 263 (81%)
4 9 (1.9%) 2 (0.6%)
dev_act_1 794 -2.2 (22.6) -1.8 (21.6) 0.6
Unknown 9 2
dev_act_7 794 0.3 (17.0) 0.2 (17.0) 0.8
Unknown 9 2
dev_act_3 794 -11.0 (33.8) -16.3 (38.7) 0.10
Unknown 9 2
dev_act_6 794 -9.7 (33.0) -13.7 (37.4) >0.9
Unknown 9 2
dev_act_wknd_1 755 0.3
2 264 (59%) 171 (55%)
3 182 (41%) 138 (45%)
Unknown 33 17
dev_act_wknd_2 772 0.7
2 267 (58%) 179 (57%)
3 190 (42%) 136 (43%)
Unknown 22 11
dev_act_wknd_3 677 0.3
2 180 (44%) 128 (48%)
3 230 (56%) 139 (52%)
Unknown 69 59
dev_act_wknd_4 687 0.3
2 249 (60%) 174 (64%)
3 165 (40%) 99 (36%)
Unknown 65 53
da_wknd_time_1 435 3.6 (1.8) 3.0 (8.1) 0.11
Unknown 215 155
da_wknd_time_2 446 3.3 (6.9) 3.6 (2.4) 0.8
Unknown 212 147
da_wknd_time_3 308 1.8 (11.1) 1.8 (9.4) 0.15
Unknown 299 198
da_wknd_time_6 423 1.4 (14.7) 3.7 (2.7) 0.042
Unknown 230 152
dev_act_covid_1 794 0.5
1 11 (2.3%) 11 (3.4%)
2 36 (7.7%) 25 (7.7%)
3 148 (31%) 115 (35%)
4 160 (34%) 112 (35%)
5 105 (22%) 57 (18%)
6 10 (2.1%) 4 (1.2%)
Unknown 9 2
dev_act_covid_2 794 0.3
1 8 (1.7%) 2 (0.6%)
2 58 (12%) 49 (15%)
3 148 (31%) 102 (31%)
4 176 (37%) 118 (36%)
5 72 (15%) 52 (16%)
6 8 (1.7%) 1 (0.3%)
Unknown 9 2
dev_act_covid_3 794 0.6
1 10 (2.1%) 7 (2.2%)
2 53 (11%) 31 (9.6%)
3 186 (40%) 147 (45%)
4 149 (32%) 87 (27%)
5 57 (12%) 42 (13%)
6 15 (3.2%) 10 (3.1%)
Unknown 9 2
dev_act_covid_4 794 >0.9
1 5 (1.1%) 2 (0.6%)
2 36 (7.7%) 26 (8.0%)
3 191 (41%) 131 (40%)
4 163 (35%) 115 (35%)
5 72 (15%) 47 (15%)
6 3 (0.6%) 3 (0.9%)
Unknown 9 2
dev_act_covid_5 794 0.5
1 8 (1.7%) 3 (0.9%)
2 31 (6.6%) 20 (6.2%)
3 165 (35%) 127 (39%)
4 190 (40%) 113 (35%)
5 72 (15%) 59 (18%)
6 4 (0.9%) 2 (0.6%)
Unknown 9 2
dev_act_covid_6 794 0.6
1 5 (1.1%) 4 (1.2%)
2 44 (9.4%) 39 (12%)
3 203 (43%) 126 (39%)
4 151 (32%) 100 (31%)
5 62 (13%) 51 (16%)
6 5 (1.1%) 4 (1.2%)
Unknown 9 2
dev_act_covid_7 794 0.027
1 6 (1.3%) 9 (2.8%)
2 31 (6.6%) 19 (5.9%)
3 145 (31%) 87 (27%)
4 196 (42%) 116 (36%)
5 70 (15%) 75 (23%)
6 22 (4.7%) 18 (5.6%)
Unknown 9 2
other_act_1 805 -12.1 (36.1) -11.7 (35.5) 0.7
other_act_2 805 -3.6 (23.0) -2.2 (19.8) 0.8
other_act_3 805 -2.6 (20.8) -2.6 (20.5) 0.5
other_act_4 805 -25.1 (44.7) -23.0 (43.4) 0.6
other_act_wknd_1 690 >0.9
2 171 (42%) 118 (42%)
3 239 (58%) 162 (58%)
Unknown 69 46
other_act_wknd_2 767 >0.9
2 261 (57%) 180 (58%)
3 193 (43%) 133 (42%)
Unknown 25 13
other_act_wknd_3 770 0.4
2 220 (48%) 140 (45%)
3 238 (52%) 172 (55%)
Unknown 21 14
other_act_wknd_4 601 0.3
2 176 (50%) 112 (45%)
3 178 (50%) 135 (55%)
Unknown 125 79
oa_wknd_time_1 532 2.9 (6.4) 2.4 (10.2) >0.9
Unknown 163 110
oa_wknd_time_2 567 1.6 (9.8) 2.0 (7.1) >0.9
Unknown 139 99
oa_wknd_time_3 570 0.9 (11.1) 2.3 (2.4) 0.030
Unknown 138 97
oa_wknd_time_4 463 -0.2 (15.0) 0.4 (12.9) 0.7
Unknown 204 138
other_act_covid_1 805 0.064
1 12 (2.5%) 13 (4.0%)
2 41 (8.6%) 29 (8.9%)
3 199 (42%) 164 (50%)
4 137 (29%) 67 (21%)
5 75 (16%) 45 (14%)
6 15 (3.1%) 8 (2.5%)
other_act_covid_2 805 0.4
1 5 (1.0%) 7 (2.1%)
2 49 (10%) 27 (8.3%)
3 170 (35%) 124 (38%)
4 158 (33%) 116 (36%)
5 90 (19%) 50 (15%)
6 7 (1.5%) 2 (0.6%)
other_act_covid_3 805 0.4
1 10 (2.1%) 2 (0.6%)
2 44 (9.2%) 21 (6.4%)
3 198 (41%) 149 (46%)
4 147 (31%) 101 (31%)
5 71 (15%) 48 (15%)
6 9 (1.9%) 5 (1.5%)
other_act_covid_4 805 0.3
1 12 (2.5%) 14 (4.3%)
2 45 (9.4%) 24 (7.4%)
3 206 (43%) 154 (47%)
4 133 (28%) 87 (27%)
5 44 (9.2%) 29 (8.9%)
6 39 (8.1%) 18 (5.5%)
number_missing_value 805 14.8 (6.6) 15.1 (6.4) 0.4
upper_out 805
97.3399999999999 479 (100%) 326 (100%)
upper_out2 805
71.24 479 (100%) 326 (100%)
lower_out 805
0.7 479 (100%) 326 (100%)
lower_out2 805
1.36 479 (100%) 326 (100%)
na_low 805
5 479 (100%) 326 (100%)
na_upp 805
58.1999999999999 479 (100%) 326 (100%)
duration_min_out 805 0.3
Spend too much time 10 (2.1%) 3 (0.9%)
Normal 469 (98%) 323 (99%)
Spend too little time 0 (0%) 0 (0%)
duration_min_out2 805 0.3
Above 95% quantile 23 (4.8%) 10 (3.1%)
Normal 456 (95%) 316 (97%)
Below 5% quantile 0 (0%) 0 (0%)
nas_out 805 0.9
Above 85% quantile 0 (0%) 0 (0%)
Normal 383 (80%) 259 (79%)
Below 10% quantile 96 (20%) 67 (21%)
odd_r 805
Normal 479 (100%) 326 (100%)
odd_r2 805
Normal 479 (100%) 326 (100%)
rep_email 805
first_entry 479 (100%) 326 (100%)

1 Mean (SD); n (%)

2 Wilcoxon rank sum test; Pearson's Chi-squared test; Fisher's exact test

Section Ib. Energy Use by Zip code

san2 %>%
  select(16, 81:87, 175, 178:189) %>% 
  tbl_summary(by = zipcode, 
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>% 
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section Ib. Energy Use (N = {N})**") %>% 
  bold_labels()
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
pre_electric 805 172.2 (408.8) 173.8 (553.8) 0.3
post_electric 805 170.3 (304.2) 163.8 (265.3) 0.4
pre_gas 805 214.5 (382.2) 214.9 (587.1) 0.016
post_gas 805 164.3 (423.6) 185.6 (601.5) 0.6
num_vehicles 805 0.2
0 14 (2.9%) 12 (3.7%)
1 264 (55%) 167 (51%)
2 188 (39%) 130 (40%)
3 12 (2.5%) 16 (4.9%)
5 1 (0.2%) 0 (0%)
20 0 (0%) 1 (0.3%)
pre_trans 805 335.3 (483.0) 421.0 (726.2) 0.042
post_trans 805 198.2 (557.8) 255.5 (705.8) 0.051
number_missing_value 805 14.8 (6.6) 15.1 (6.4) 0.4
upper_out 805
97.3399999999999 479 (100%) 326 (100%)
upper_out2 805
71.24 479 (100%) 326 (100%)
lower_out 805
0.7 479 (100%) 326 (100%)
lower_out2 805
1.36 479 (100%) 326 (100%)
na_low 805
5 479 (100%) 326 (100%)
na_upp 805
58.1999999999999 479 (100%) 326 (100%)
duration_min_out 805 0.3
Spend too much time 10 (2.1%) 3 (0.9%)
Normal 469 (98%) 323 (99%)
Spend too little time 0 (0%) 0 (0%)
duration_min_out2 805 0.3
Above 95% quantile 23 (4.8%) 10 (3.1%)
Normal 456 (95%) 316 (97%)
Below 5% quantile 0 (0%) 0 (0%)
nas_out 805 0.9
Above 85% quantile 0 (0%) 0 (0%)
Normal 383 (80%) 259 (79%)
Below 10% quantile 96 (20%) 67 (21%)
odd_r 805
Normal 479 (100%) 326 (100%)
odd_r2 805
Normal 479 (100%) 326 (100%)
rep_email 805
first_entry 479 (100%) 326 (100%)

1 Mean (SD); n (%)

2 Wilcoxon rank sum test; Fisher's exact test

Section II. Health Conditions by Zip code

san2 %>%
  select(16, 88:101, 103, 105:119, 175, 178:189) %>% 
  tbl_summary(by = zipcode, 
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>% 
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section II. Health Conditions (N = {N})**") %>% 
  bold_labels()
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
health 805 0.5
1 81 (17%) 49 (15%)
2 203 (42%) 123 (38%)
3 167 (35%) 131 (40%)
4 23 (4.8%) 18 (5.5%)
5 5 (1.0%) 5 (1.5%)
mental_health_anxious 805 0.002
-99 3 (0.6%) 15 (4.6%)
1 142 (30%) 92 (28%)
2 177 (37%) 115 (35%)
3 115 (24%) 85 (26%)
4 42 (8.8%) 19 (5.8%)
mental_health_worry 805 0.004
-99 6 (1.3%) 18 (5.5%)
1 185 (39%) 125 (38%)
2 142 (30%) 93 (29%)
3 109 (23%) 76 (23%)
4 37 (7.7%) 14 (4.3%)
mental_health_interest 805 0.002
-99 4 (0.8%) 16 (4.9%)
1 140 (29%) 79 (24%)
2 173 (36%) 133 (41%)
3 124 (26%) 75 (23%)
4 38 (7.9%) 23 (7.1%)
mental_health_down 805 0.028
-99 8 (1.7%) 18 (5.5%)
1 185 (39%) 123 (38%)
2 134 (28%) 81 (25%)
3 114 (24%) 84 (26%)
4 38 (7.9%) 20 (6.1%)
physical_health 805 3.2 (3.6) 2.9 (3.1) 0.7
mental_health 805 4.1 (5.0) 3.7 (4.4) 0.8
pre_phy_health 805 >0.9
-99 3 (0.6%) 2 (0.6%)
1 46 (9.6%) 28 (8.6%)
2 308 (64%) 207 (63%)
3 122 (25%) 89 (27%)
pre_mental_health 805 0.3
-99 1 (0.2%) 4 (1.2%)
1 94 (20%) 62 (19%)
2 270 (56%) 177 (54%)
3 114 (24%) 83 (25%)
days_poor_health 805 3.2 (4.5) 3.0 (4.3) 0.8
impairment 805 0.5
-99 27 (5.6%) 14 (4.3%)
1 161 (34%) 103 (32%)
2 291 (61%) 209 (64%)
impairment_hsh...103 805 0.6
-99 30 (6.3%) 24 (7.4%)
1 155 (32%) 96 (29%)
2 294 (61%) 206 (63%)
num_hsh_impair 805 0.5
0 281 (59%) 207 (63%)
1 123 (26%) 81 (25%)
2 61 (13%) 31 (9.5%)
3 7 (1.5%) 4 (1.2%)
4 5 (1.0%) 1 (0.3%)
5 1 (0.2%) 0 (0%)
6 1 (0.2%) 1 (0.3%)
10 0 (0%) 1 (0.3%)
major_impairment 264 -7.4 (38.7) -6.7 (37.1) 0.5
Unknown 318 223
impairment_hsh...107 251 -6.5 (37.0) -10.5 (41.5) 0.7
Unknown 324 230
days_impairment_1 805 -30.6 (50.8) -32.0 (51.0) 0.8
weeks_impairment_4 805
-99 263 (55%) 172 (53%)
0 40 (8.4%) 20 (6.1%)
1 74 (15%) 68 (21%)
2 48 (10%) 32 (9.8%)
3 30 (6.3%) 17 (5.2%)
4 11 (2.3%) 13 (4.0%)
5 8 (1.7%) 1 (0.3%)
6 2 (0.4%) 2 (0.6%)
7 3 (0.6%) 1 (0.3%)
months_impairment_1 805 -59.1 (49.4) -60.2 (49.3) >0.9
years_impairment_1 805
-99 303 (63%) 210 (64%)
0 61 (13%) 28 (8.6%)
1 53 (11%) 42 (13%)
2 30 (6.3%) 26 (8.0%)
3 11 (2.3%) 10 (3.1%)
4 10 (2.1%) 5 (1.5%)
5 6 (1.3%) 3 (0.9%)
6 2 (0.4%) 1 (0.3%)
7 3 (0.6%) 1 (0.3%)
med_device_1 805 0.2
-99 255 (53%) 158 (48%)
0 129 (27%) 108 (33%)
1 95 (20%) 60 (18%)
med_device_2 805 0.2
-99 255 (53%) 158 (48%)
0 188 (39%) 132 (40%)
1 36 (7.5%) 36 (11%)
med_device_3 805 0.4
-99 255 (53%) 158 (48%)
0 192 (40%) 142 (44%)
1 32 (6.7%) 26 (8.0%)
med_device_4 805 0.3
-99 255 (53%) 158 (48%)
0 196 (41%) 151 (46%)
1 28 (5.8%) 17 (5.2%)
med_device_5 805 0.4
-99 255 (53%) 158 (48%)
0 172 (36%) 126 (39%)
1 52 (11%) 42 (13%)
med_device_6 805 0.4
-99 255 (53%) 158 (48%)
0 223 (47%) 167 (51%)
1 1 (0.2%) 1 (0.3%)
med_device_7 805 0.3
-99 255 (53%) 158 (48%)
0 180 (38%) 130 (40%)
1 44 (9.2%) 38 (12%)
med_device_8 805 0.2
-99 255 (53%) 158 (48%)
0 174 (36%) 123 (38%)
1 50 (10%) 45 (14%)
med_device_9 805 0.2
-99 255 (53%) 158 (48%)
0 203 (42%) 146 (45%)
1 21 (4.4%) 22 (6.7%)
med_device_10 805 0.4
-99 255 (53%) 158 (48%)
0 208 (43%) 154 (47%)
1 16 (3.3%) 14 (4.3%)
med_device_11 805 0.4
-99 255 (53%) 158 (48%)
0 219 (46%) 165 (51%)
1 5 (1.0%) 3 (0.9%)
number_missing_value 805 14.8 (6.6) 15.1 (6.4) 0.4
upper_out 805
97.3399999999999 479 (100%) 326 (100%)
upper_out2 805
71.24 479 (100%) 326 (100%)
lower_out 805
0.7 479 (100%) 326 (100%)
lower_out2 805
1.36 479 (100%) 326 (100%)
na_low 805
5 479 (100%) 326 (100%)
na_upp 805
58.1999999999999 479 (100%) 326 (100%)
duration_min_out 805 0.3
Spend too much time 10 (2.1%) 3 (0.9%)
Normal 469 (98%) 323 (99%)
Spend too little time 0 (0%) 0 (0%)
duration_min_out2 805 0.3
Above 95% quantile 23 (4.8%) 10 (3.1%)
Normal 456 (95%) 316 (97%)
Below 5% quantile 0 (0%) 0 (0%)
nas_out 805 0.9
Above 85% quantile 0 (0%) 0 (0%)
Normal 383 (80%) 259 (79%)
Below 10% quantile 96 (20%) 67 (21%)
odd_r 805
Normal 479 (100%) 326 (100%)
odd_r2 805
Normal 479 (100%) 326 (100%)
rep_email 805
first_entry 479 (100%) 326 (100%)

1 n (%); Mean (SD)

2 Fisher's exact test; Pearson's Chi-squared test; Wilcoxon rank sum test

Section III. Employment by Zip code

san2 %>%
  select(16, 121:143, 175, 178:189) %>% 
  tbl_summary(by = zipcode, 
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>% 
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section III. Employment (N = {N})**") %>% 
  bold_labels()
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
emp_status 805
1 336 (70%) 234 (72%)
2 25 (5.2%) 12 (3.7%)
3 48 (10%) 21 (6.4%)
4 46 (9.6%) 41 (13%)
5 1 (0.2%) 2 (0.6%)
6 9 (1.9%) 9 (2.8%)
7 14 (2.9%) 7 (2.1%)
emp_status_partner 805
1 270 (56%) 226 (69%)
2 39 (8.1%) 11 (3.4%)
3 58 (12%) 14 (4.3%)
4 68 (14%) 44 (13%)
5 3 (0.6%) 2 (0.6%)
6 9 (1.9%) 6 (1.8%)
7 32 (6.7%) 23 (7.1%)
work_home 805 0.3
-99 11 (2.3%) 12 (3.7%)
3 332 (69%) 212 (65%)
4 136 (28%) 102 (31%)
work_home_partner 805 0.9
-99 39 (8.1%) 30 (9.2%)
1 279 (58%) 188 (58%)
2 161 (34%) 108 (33%)
frontline 805 0.054
-99 11 (2.3%) 8 (2.5%)
1 176 (37%) 147 (45%)
2 292 (61%) 171 (52%)
frontline_partner 805 0.2
-99 36 (7.5%) 28 (8.6%)
1 163 (34%) 130 (40%)
2 280 (58%) 168 (52%)
hrs_work_3 805 32.3 (28.1) 30.5 (33.0) 0.6
hrs_work_4 805 -29.9 (61.5) -38.8 (61.3) 0.059
hrs_work_partner_3 805 16.8 (47.1) 21.1 (44.0) 0.4
hrs_work_partner_4 805 -36.2 (63.1) -44.7 (60.6) 0.038
min_commute_3 805 10.3 (44.1) 11.6 (43.4) 0.7
hrs_commute_3 805 0.3
-99 203 (42%) 146 (45%)
0 109 (23%) 53 (16%)
1 128 (27%) 98 (30%)
2 32 (6.7%) 22 (6.7%)
3 6 (1.3%) 6 (1.8%)
4 1 (0.2%) 1 (0.3%)
min_commute_partner_3 805 -2.6 (54.0) 3.1 (51.2) 0.2
hrs_commute_partnet_3 805 0.11
-99 251 (52%) 154 (47%)
0 84 (18%) 47 (14%)
1 102 (21%) 98 (30%)
2 32 (6.7%) 19 (5.8%)
3 8 (1.7%) 7 (2.1%)
4 2 (0.4%) 1 (0.3%)
rsn_nowork 232 0.9
-99 12 (8.5%) 8 (8.9%)
1 4 (2.8%) 4 (4.4%)
2 32 (23%) 16 (18%)
3 80 (56%) 52 (58%)
4 14 (9.9%) 10 (11%)
Unknown 337 236
rsn_nowork_partner 304 0.2
-99 32 (16%) 25 (26%)
1 3 (1.5%) 2 (2.0%)
2 49 (24%) 23 (23%)
3 101 (49%) 42 (43%)
4 21 (10%) 6 (6.1%)
Unknown 273 228
eip_1 805 0.3
-99 21 (4.4%) 17 (5.2%)
0 214 (45%) 161 (49%)
1 244 (51%) 148 (45%)
eip_2 805 0.6
-99 21 (4.4%) 17 (5.2%)
0 227 (47%) 143 (44%)
1 231 (48%) 166 (51%)
eip_3 805 0.3
-99 21 (4.4%) 17 (5.2%)
0 345 (72%) 217 (67%)
1 113 (24%) 92 (28%)
eip_4 805 0.5
-99 21 (4.4%) 17 (5.2%)
0 264 (55%) 166 (51%)
1 194 (41%) 143 (44%)
eip_5 805 0.9
-99 21 (4.4%) 17 (5.2%)
0 269 (56%) 182 (56%)
1 189 (39%) 127 (39%)
eip_6 805 0.8
-99 21 (4.4%) 17 (5.2%)
0 451 (94%) 305 (94%)
1 7 (1.5%) 4 (1.2%)
eip_7 805 0.2
-99 21 (4.4%) 17 (5.2%)
0 453 (95%) 301 (92%)
1 5 (1.0%) 8 (2.5%)
number_missing_value 805 14.8 (6.6) 15.1 (6.4) 0.4
upper_out 805
97.3399999999999 479 (100%) 326 (100%)
upper_out2 805
71.24 479 (100%) 326 (100%)
lower_out 805
0.7 479 (100%) 326 (100%)
lower_out2 805
1.36 479 (100%) 326 (100%)
na_low 805
5 479 (100%) 326 (100%)
na_upp 805
58.1999999999999 479 (100%) 326 (100%)
duration_min_out 805 0.3
Spend too much time 10 (2.1%) 3 (0.9%)
Normal 469 (98%) 323 (99%)
Spend too little time 0 (0%) 0 (0%)
duration_min_out2 805 0.3
Above 95% quantile 23 (4.8%) 10 (3.1%)
Normal 456 (95%) 316 (97%)
Below 5% quantile 0 (0%) 0 (0%)
nas_out 805 0.9
Above 85% quantile 0 (0%) 0 (0%)
Normal 383 (80%) 259 (79%)
Below 10% quantile 96 (20%) 67 (21%)
odd_r 805
Normal 479 (100%) 326 (100%)
odd_r2 805
Normal 479 (100%) 326 (100%)
rep_email 805
first_entry 479 (100%) 326 (100%)

1 n (%); Mean (SD)

2 Pearson's Chi-squared test; Wilcoxon rank sum test; Fisher's exact test

Part III.

san.ia %>% 
  select(2, 15:18, 28:30, 44:50, 63:66, 70:84) %>% 
  tbl_summary(by = zipcode, 
              statistic = list(all_continuous() ~ "{mean} ({sd})"),
              digits = list(all_continuous() ~ c(1, 1))) %>% 
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section Ia. Time Use (N = {N})**") %>% 
  bold_labels()
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
sleep.covid 805 0.2
About the same 182 (38%) 143 (44%)
Much less time 22 (4.6%) 8 (2.5%)
Much more time 106 (22%) 61 (19%)
Somewhat less time 32 (6.7%) 26 (8.0%)
Somewhat more time 137 (29%) 88 (27%)
eat.covid 805 0.5
About the same 226 (47%) 153 (47%)
Much less time 1 (0.2%) 1 (0.3%)
Much more time 69 (14%) 37 (11%)
Somewhat less time 50 (10%) 30 (9.2%)
Somewhat more time 133 (28%) 105 (32%)
cook.covid 800 >0.9
About the same 242 (51%) 165 (51%)
Much less time 6 (1.3%) 3 (0.9%)
Much more time 68 (14%) 45 (14%)
Somewhat less time 37 (7.8%) 23 (7.1%)
Somewhat more time 124 (26%) 87 (27%)
Unknown 2 3
groom.covid 801 >0.9
About the same 238 (50%) 172 (53%)
Much less time 10 (2.1%) 7 (2.2%)
Much more time 48 (10%) 31 (9.6%)
Somewhat less time 53 (11%) 33 (10%)
Somewhat more time 128 (27%) 81 (25%)
Unknown 2 2
class.covid 662 0.7
About the same 165 (41%) 115 (45%)
Much less time 23 (5.7%) 16 (6.3%)
Much more time 50 (12%) 25 (9.8%)
Somewhat less time 94 (23%) 53 (21%)
Somewhat more time 75 (18%) 46 (18%)
Unknown 72 71
hmwrk.covid 655 0.005
About the same 166 (41%) 86 (34%)
Much less time 15 (3.7%) 11 (4.3%)
Much more time 48 (12%) 18 (7.1%)
Somewhat less time 86 (21%) 52 (21%)
Somewhat more time 87 (22%) 86 (34%)
Unknown 77 73
commute.covid 626 0.5
About the same 167 (42%) 97 (42%)
Much less time 58 (15%) 46 (20%)
Much more time 22 (5.6%) 14 (6.0%)
Somewhat less time 84 (21%) 40 (17%)
Somewhat more time 62 (16%) 36 (15%)
Unknown 86 93
tv.covid 780 0.4
About the same 148 (32%) 115 (36%)
Much less time 11 (2.4%) 11 (3.4%)
Much more time 105 (23%) 57 (18%)
Somewhat less time 36 (7.8%) 25 (7.8%)
Somewhat more time 160 (35%) 112 (35%)
Unknown 19 6
stream.covid 785 0.6
About the same 148 (32%) 102 (32%)
Much less time 8 (1.7%) 2 (0.6%)
Much more time 72 (16%) 52 (16%)
Somewhat less time 58 (13%) 49 (15%)
Somewhat more time 176 (38%) 118 (37%)
Unknown 17 3
radio.covid 769 0.4
About the same 186 (41%) 147 (47%)
Much less time 10 (2.2%) 7 (2.2%)
Much more time 57 (13%) 42 (13%)
Somewhat less time 53 (12%) 31 (9.9%)
Somewhat more time 149 (33%) 87 (28%)
Unknown 24 12
snet.covid 788 >0.9
About the same 191 (41%) 131 (41%)
Much less time 5 (1.1%) 2 (0.6%)
Much more time 72 (15%) 47 (15%)
Somewhat less time 36 (7.7%) 26 (8.1%)
Somewhat more time 163 (35%) 115 (36%)
Unknown 12 5
text.covid 788 0.4
About the same 165 (35%) 127 (39%)
Much less time 8 (1.7%) 3 (0.9%)
Much more time 72 (15%) 59 (18%)
Somewhat less time 31 (6.7%) 20 (6.2%)
Somewhat more time 190 (41%) 113 (35%)
Unknown 13 4
pc.covid 785 0.5
About the same 203 (44%) 126 (39%)
Much less time 5 (1.1%) 4 (1.2%)
Much more time 62 (13%) 51 (16%)
Somewhat less time 44 (9.5%) 39 (12%)
Somewhat more time 151 (32%) 100 (31%)
Unknown 14 6
xbox.covid 754 0.015
About the same 145 (32%) 87 (28%)
Much less time 6 (1.3%) 9 (2.9%)
Much more time 70 (16%) 75 (25%)
Somewhat less time 31 (6.9%) 19 (6.2%)
Somewhat more time 196 (44%) 116 (38%)
Unknown 31 20
read.covid 782 0.039
About the same 199 (43%) 164 (52%)
Much less time 12 (2.6%) 13 (4.1%)
Much more time 75 (16%) 45 (14%)
Somewhat less time 41 (8.8%) 29 (9.1%)
Somewhat more time 137 (30%) 67 (21%)
Unknown 15 8
clean.covid 796 0.4
About the same 170 (36%) 124 (38%)
Much less time 5 (1.1%) 7 (2.2%)
Much more time 90 (19%) 50 (15%)
Somewhat less time 49 (10%) 27 (8.3%)
Somewhat more time 158 (33%) 116 (36%)
Unknown 7 2
wash.covid 791 0.2
About the same 198 (42%) 149 (46%)
Much less time 10 (2.1%) 2 (0.6%)
Much more time 71 (15%) 48 (15%)
Somewhat less time 44 (9.4%) 21 (6.5%)
Somewhat more time 147 (31%) 101 (31%)
Unknown 9 5
repair.covid 748 0.5
About the same 206 (47%) 154 (50%)
Much less time 12 (2.7%) 14 (4.5%)
Much more time 44 (10%) 29 (9.4%)
Somewhat less time 45 (10%) 24 (7.8%)
Somewhat more time 133 (30%) 87 (28%)
Unknown 39 18
sleep.tt 805 57.3 (12.1) 57.5 (11.1) 0.8
eat.tt 802 18.7 (15.4) 17.5 (13.3) 0.2
Unknown 2 1
cook.tt 783 15.1 (16.2) 13.8 (13.3) 0.3
Unknown 11 11
groom.tt 792 13.0 (16.2) 12.3 (14.3) 0.6
Unknown 7 6
class.tt 603 36.7 (20.9) 35.9 (22.4) 0.5
Unknown 103 99
hmwrk.tt 575 20.5 (18.4) 19.3 (19.7) 0.029
Unknown 126 104
commute.tt 503 16.0 (20.5) 15.8 (19.9) 0.5
Unknown 154 148
tv.tt 754 22.5 (17.2) 21.8 (16.9) 0.3
Unknown 33 18
pc.tt 771 22.1 (17.4) 22.1 (16.3) 0.8
Unknown 23 11
radio.tt 673 13.9 (17.5) 12.6 (14.3) 0.6
Unknown 71 61
xbox.tt 681 17.8 (18.8) 19.2 (17.4) 0.069
Unknown 70 54
read.tt 687 19.8 (19.3) 18.8 (17.7) 0.5
Unknown 71 47
clean.tt 764 13.7 (15.1) 13.2 (13.2) 0.8
Unknown 27 14
wash.tt 767 12.8 (16.3) 12.4 (13.2) 0.4
Unknown 24 14
repair.tt 594 13.2 (17.4) 12.3 (15.2) >0.9
Unknown 131 80

1 n (%); Mean (SD)

2 Pearson's Chi-squared test; Fisher's exact test; Wilcoxon rank sum test

san.ib %>% 
  select(2, pre_electric:post_trans) %>% 
  tbl_summary(by = zipcode,
              statistic = list(all_continuous() ~ "{mean} ({sd})"),
              digits = list(all_continuous() ~ c(1, 1))) %>%
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section Ib. Energy Use (N = {N})**") %>% 
  bold_labels()
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
pre_electric 805 172.2 (408.8) 173.8 (553.8) 0.3
post_electric 805 170.3 (304.2) 163.8 (265.3) 0.4
pre_gas 805 214.5 (382.2) 214.9 (587.1) 0.016
post_gas 805 164.3 (423.6) 185.6 (601.5) 0.6
num_vehicles 805 0.2
0 14 (2.9%) 12 (3.7%)
1 264 (55%) 167 (51%)
2 188 (39%) 130 (40%)
3 12 (2.5%) 16 (4.9%)
5 1 (0.2%) 0 (0%)
20 0 (0%) 1 (0.3%)
pre_trans 805 335.3 (483.0) 421.0 (726.2) 0.042
post_trans 805 198.2 (557.8) 255.5 (705.8) 0.051

1 Mean (SD); n (%)

2 Wilcoxon rank sum test; Fisher's exact test

san.ii %>% 
  select(2:32) %>% 
  tbl_summary(by = zipcode,
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>%
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section II. Health Conditions (N = {N})**") %>% 
  bold_labels()
## There was an error in 'add_p()/add_difference()' for variable 'major_impairment', p-value omitted:
## Error in stats::fisher.test(c(NA, "Depression/anxiety/emotional problem", : FEXACT error 7(location). LDSTP=18600 is too small for this problem,
##   (pastp=33.788, ipn_0:=ipoin[itp=362]=4216, stp[ipn_0]=31.5477).
## Increase workspace or consider using 'simulate.p.value=TRUE'
## There was an error in 'add_p()/add_difference()' for variable 'major_impairment_hsh', p-value omitted:
## Error in stats::fisher.test(c(NA, "Depression/anxiety/emotional problem", : FEXACT error 7(location). LDSTP=18630 is too small for this problem,
##   (pastp=25.084, ipn_0:=ipoin[itp=446]=1300, stp[ipn_0]=18.055).
## Increase workspace or consider using 'simulate.p.value=TRUE'
## There was an error in 'add_p()/add_difference()' for variable 'weeks_impairment_4', p-value omitted:
## Error in stats::fisher.test(c(NA, 4, 2, 5, 2, 3, NA, NA, NA, NA, 3, NA, : FEXACT error 7(location). LDSTP=18600 is too small for this problem,
##   (pastp=90.349, ipn_0:=ipoin[itp=244]=375, stp[ipn_0]=87.3558).
## Increase workspace or consider using 'simulate.p.value=TRUE'
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
health 805 0.5
Excellent 81 (17%) 49 (15%)
Very good 203 (42%) 123 (38%)
Good 167 (35%) 131 (40%)
Fair 23 (4.8%) 18 (5.5%)
Poor 5 (1.0%) 5 (1.5%)
mental_health_anxious 787 0.5
More than half the days 115 (24%) 85 (27%)
Nearly every day 42 (8.8%) 19 (6.1%)
Not at all 142 (30%) 92 (30%)
Several days 177 (37%) 115 (37%)
Unknown 3 15
mental_health_worry 781 0.3
More than half the days 109 (23%) 76 (25%)
Nearly every day 37 (7.8%) 14 (4.5%)
Not at all 185 (39%) 125 (41%)
Several days 142 (30%) 93 (30%)
Unknown 6 18
mental_health_interest 785 0.3
More than half the days 124 (26%) 75 (24%)
Nearly every day 38 (8.0%) 23 (7.4%)
Not at all 140 (29%) 79 (25%)
Several days 173 (36%) 133 (43%)
Unknown 4 16
mental_health_down 779 0.6
More than half the days 114 (24%) 84 (27%)
Nearly every day 38 (8.1%) 20 (6.5%)
Not at all 185 (39%) 123 (40%)
Several days 134 (28%) 81 (26%)
Unknown 8 18
physical_health 805 3.2 (3.6) 2.9 (3.1) 0.7
mental_health 805 4.1 (5.0) 3.7 (4.4) 0.8
pre_phy_health 285 0.6
Worse 46 (27%) 28 (24%)
Same 0 (0%) 0 (0%)
Better 122 (73%) 89 (76%)
Unknown 311 209
pre_mental_health 353 0.7
Worse 94 (45%) 62 (43%)
Same 0 (0%) 0 (0%)
Better 114 (55%) 83 (57%)
Unknown 271 181
days_poor_health 805 3.2 (4.5) 3.0 (4.3) 0.8
impairment 764 161 (36%) 103 (33%) 0.5
Unknown 27 14
impairment_hsh 751 155 (35%) 96 (32%) 0.4
Unknown 30 24
num_hsh_impair 805 0.5
0 281 (59%) 207 (63%)
1 123 (26%) 81 (25%)
2 61 (13%) 31 (9.5%)
3 7 (1.5%) 4 (1.2%)
4 5 (1.0%) 1 (0.3%)
5 1 (0.2%) 0 (0%)
6 1 (0.2%) 1 (0.3%)
10 0 (0%) 1 (0.3%)
major_impairment 226
Arthritis/rheumatism 13 (9.5%) 12 (13%)
Back or neck problem 8 (5.8%) 8 (9.0%)
Cancer 3 (2.2%) 1 (1.1%)
Depression/anxiety/emotional problem 53 (39%) 35 (39%)
Diabetes 11 (8.0%) 0 (0%)
Eye/vision problem 12 (8.8%) 6 (6.7%)
Fractures, bone/joint injury 9 (6.6%) 8 (9.0%)
Hearing problem 5 (3.6%) 1 (1.1%)
Heart problem 8 (5.8%) 3 (3.4%)
Hypertension/high blood pressure 4 (2.9%) 4 (4.5%)
Lung/breathing problem 4 (2.9%) 2 (2.2%)
Other impairment/problem 1 (0.7%) 0 (0%)
Stroke problem 2 (1.5%) 3 (3.4%)
Walking problem 4 (2.9%) 6 (6.7%)
Unknown 342 237
major_impairment_hsh 213
Arthritis/rheumatism 15 (11%) 9 (11%)
Back or neck problem 15 (11%) 8 (10%)
Cancer 0 (0%) 3 (3.8%)
Depression/anxiety/emotional problem 43 (32%) 38 (48%)
Diabetes 14 (10%) 0 (0%)
Eye/vision problem 10 (7.5%) 4 (5.1%)
Fractures, bone/joint injury 9 (6.7%) 5 (6.3%)
Hearing problem 3 (2.2%) 2 (2.5%)
Heart problem 9 (6.7%) 2 (2.5%)
Hypertension/high blood pressure 3 (2.2%) 1 (1.3%)
Lung/breathing problem 2 (1.5%) 2 (2.5%)
Other impairment/problem 1 (0.7%) 0 (0%)
Stroke problem 6 (4.5%) 2 (2.5%)
Walking problem 4 (3.0%) 3 (3.8%)
Unknown 345 247
days_impairment_1 517 6.7 (5.5) 6.6 (4.8) 0.9
Unknown 169 119
weeks_impairment_4 370
0 40 (19%) 20 (13%)
1 74 (34%) 68 (44%)
2 48 (22%) 32 (21%)
3 30 (14%) 17 (11%)
4 11 (5.1%) 13 (8.4%)
5 8 (3.7%) 1 (0.6%)
6 2 (0.9%) 2 (1.3%)
7 3 (1.4%) 1 (0.6%)
Unknown 263 172
months_impairment_1 314 2.0 (2.1) 2.1 (2.0) 0.2
Unknown 290 201
years_impairment_1 292 0.6
0 61 (35%) 28 (24%)
1 53 (30%) 42 (36%)
2 30 (17%) 26 (22%)
3 11 (6.2%) 10 (8.6%)
4 10 (5.7%) 5 (4.3%)
5 6 (3.4%) 3 (2.6%)
6 2 (1.1%) 1 (0.9%)
7 3 (1.7%) 1 (0.9%)
Unknown 303 210
wheelchair 392 95 (42%) 60 (36%) 0.2
Unknown 255 158
e_bed 392 36 (16%) 36 (21%) 0.2
Unknown 255 158
person_lifting 392 32 (14%) 26 (15%) 0.7
Unknown 255 158
dialysis_machine 392 28 (12%) 17 (10%) 0.5
Unknown 255 158
ventilator 392 52 (23%) 42 (25%) 0.7
Unknown 255 158
cpap_bipap 392 1 (0.4%) 1 (0.6%) >0.9
Unknown 255 158
nebulizer 392 44 (20%) 38 (23%) 0.5
Unknown 255 158
e_recliner 392 50 (22%) 45 (27%) 0.3
Unknown 255 158
iv_pump 392 21 (9.4%) 22 (13%) 0.2
Unknown 255 158
phototherapy 392 16 (7.1%) 14 (8.3%) 0.7
Unknown 255 158
other 392 5 (2.2%) 3 (1.8%) >0.9
Unknown 255 158

1 n (%); Mean (SD)

2 Fisher's exact test; Pearson's Chi-squared test; Wilcoxon rank sum test

san.iii %>% 
  select(2:25, 29:32) %>% 
  tbl_summary(by = zipcode,
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>%
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section III. Employment (N = {N})**") %>% 
  bold_labels()
## There was an error in 'add_p()/add_difference()' for variable 'emp_status_partner', p-value omitted:
## Error in stats::fisher.test(c("Work for pay at a job", "Work for pay at a job", : FEXACT error 7(location). LDSTP=18510 is too small for this problem,
##   (pastp=81.2377, ipn_0:=ipoin[itp=165]=1207, stp[ipn_0]=79.7203).
## Increase workspace or consider using 'simulate.p.value=TRUE'
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
emp_status 784 0.2
Actively looking for a job 46 (9.9%) 41 (13%)
Layoff from a job 25 (5.4%) 12 (3.8%)
Retired 1 (0.2%) 2 (0.6%)
Temporarily absent from job 48 (10%) 21 (6.6%)
Unable to work 9 (1.9%) 9 (2.8%)
Work for pay at a job 336 (72%) 234 (73%)
Unknown 14 7
emp_status_partner 750
Actively looking for a job 68 (15%) 44 (15%)
Layoff from a job 39 (8.7%) 11 (3.6%)
Retired 3 (0.7%) 2 (0.7%)
Temporarily absent from job 58 (13%) 14 (4.6%)
Unable to work 9 (2.0%) 6 (2.0%)
Work for pay at a job 270 (60%) 226 (75%)
Unknown 32 23
work_home 782 332 (71%) 212 (68%) 0.3
Unknown 11 12
work_home_partner 736 279 (63%) 188 (64%) >0.9
Unknown 39 30
frontline 786 176 (38%) 147 (46%) 0.016
Unknown 11 8
frontline_partner 741 163 (37%) 130 (44%) 0.062
Unknown 36 28
hrs_work_3 769 37.5 (10.8) 38.1 (10.7) >0.9
Unknown 18 18
hrs_work_4 439 21.3 (20.4) 20.6 (18.6) 0.8
Unknown 204 162
hrs_work_partner_3 706 34.3 (14.4) 36.0 (12.4) 0.7
Unknown 63 36
hrs_work_partner_4 395 23.3 (21.2) 19.7 (18.9) 0.091
Unknown 233 177
min_commute_3 702 26.9 (12.1) 27.1 (13.9) 0.8
Unknown 63 40
hrs_commute_3 456 0.2
0 109 (39%) 53 (29%)
1 128 (46%) 98 (54%)
2 32 (12%) 22 (12%)
3 6 (2.2%) 6 (3.3%)
4 1 (0.4%) 1 (0.6%)
Unknown 203 146
min_commute_partner_3 633 26.1 (13.4) 27.1 (14.5) 0.8
Unknown 110 62
hrs_commute_partnet_3 400 0.14
0 84 (37%) 47 (27%)
1 102 (45%) 98 (57%)
2 32 (14%) 19 (11%)
3 8 (3.5%) 7 (4.1%)
4 2 (0.9%) 1 (0.6%)
Unknown 251 154
rsn_nowork 212 0.7
Caring for someone else 32 (25%) 16 (20%)
Employer closed 80 (62%) 52 (63%)
Other reason 14 (11%) 10 (12%)
Sick with coronavirus symptoms 4 (3.1%) 4 (4.9%)
Unknown 349 244
rsn_nowork_partner 247 0.7
Caring for someone else 49 (28%) 23 (32%)
Employer closed 101 (58%) 42 (58%)
Other reason 21 (12%) 6 (8.2%)
Sick with coronavirus symptoms 3 (1.7%) 2 (2.7%)
Unknown 305 253
eip_food 767 244 (53%) 148 (48%) 0.14
Unknown 21 17
eip_hsh 767 231 (50%) 166 (54%) 0.4
Unknown 21 17
eip_rent 767 113 (25%) 92 (30%) 0.12
Unknown 21 17
eip_utilities 767 194 (42%) 143 (46%) 0.3
Unknown 21 17
eip_credit 767 189 (41%) 127 (41%) >0.9
Unknown 21 17
eip_other 767 7 (1.5%) 4 (1.3%) >0.9
Unknown 21 17
eip_dn 767 5 (1.1%) 8 (2.6%) 0.12
Unknown 21 17
working_t 439 36.8 (11.5) 36.2 (11.0) 0.4
Unknown 204 162
working_t_p 395 32.9 (16.3) 33.5 (12.2) 0.4
Unknown 233 177
commuting_t 407 1.1 (0.8) 1.3 (0.8) 0.034
Unknown 236 162
commuting_t_p 355 1.2 (0.8) 1.3 (0.8) 0.084
Unknown 276 174

1 n (%); Mean (SD)

2 Fisher's exact test; Pearson's Chi-squared test; Wilcoxon rank sum test

san.iv %>% 
  select(2, age:ageg, race_eth:educ, depen:welfare_7) %>% 
  tbl_summary(by = zipcode,
              statistic = list(all_continuous() ~ "{mean} ({sd})",
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ c(1, 1))) %>%
  add_n() %>% 
  add_p() %>% 
  modify_header(label = "**variable**") %>% 
  modify_caption("**Section IV. Background Characteristics (N = {N})**") %>% 
  bold_labels()
## There was an error in 'add_p()/add_difference()' for variable 'sq_ft', p-value omitted:
## Error in stats::fisher.test(c("0-499 sq ft", "700-099 sq ft", "1000-1099 sq ft", : FEXACT error 7(location). LDSTP=18510 is too small for this problem,
##   (pastp=80.6694, ipn_0:=ipoin[itp=153]=3668, stp[ipn_0]=80.5102).
## Increase workspace or consider using 'simulate.p.value=TRUE'
variable N Elm Creek, N = 4791 Jefferson Heights, N = 3261 p-value2
age 805 38.5 (6.6) 38.3 (7.5) 0.4
ageg 805 0.042
20-29 31 (6.5%) 39 (12%)
30-39 278 (58%) 172 (53%)
40-49 136 (28%) 90 (28%)
50-59 33 (6.9%) 22 (6.7%)
60+ 1 (0.2%) 3 (0.9%)
race_eth 805 0.035
NH-White 179 (37%) 145 (44%)
NH-Black 44 (9.2%) 18 (5.5%)
NH-Asian 7 (1.5%) 3 (0.9%)
NH-AIAN 13 (2.7%) 7 (2.1%)
NH-NHPI 0 (0%) 4 (1.2%)
NH-Other 2 (0.4%) 2 (0.6%)
Hispanic 234 (49%) 147 (45%)
gender2 805 >0.9
Female 164 (34%) 112 (34%)
Male 310 (65%) 210 (64%)
Other 5 (1.0%) 4 (1.2%)
marital_st 805 0.7
In a union 422 (88%) 291 (89%)
Not in a union 11 (2.3%) 5 (1.5%)
Single 46 (9.6%) 30 (9.2%)
educ 802 0.5
College 316 (66%) 220 (67%)
Graduate 21 (4.4%) 21 (6.4%)
High School 132 (28%) 82 (25%)
Less than HS 7 (1.5%) 3 (0.9%)
Unknown 3 0
depen 805 367 (77%) 247 (76%) 0.8
num_hsh 805 3.7 (1.5) 3.8 (1.6) 0.6
num_children 805 1.2 (1.5) 1.3 (2.1) 0.5
num_retired 805 0.050
0 277 (58%) 159 (49%)
1 108 (23%) 81 (25%)
2 86 (18%) 83 (25%)
3 3 (0.6%) 1 (0.3%)
4 3 (0.6%) 2 (0.6%)
5 2 (0.4%) 0 (0%)
num_rooms 805 4.2 (1.6) 4.5 (1.7) 0.028
num_bedrooms 803 0.6
1 27 (5.7%) 14 (4.3%)
2 137 (29%) 92 (28%)
3 196 (41%) 149 (46%)
4 84 (18%) 50 (15%)
5 29 (6.1%) 16 (4.9%)
6 3 (0.6%) 4 (1.2%)
7 0 (0%) 1 (0.3%)
9 1 (0.2%) 0 (0%)
Unknown 2 0
sq_ft 788
+3000 sq ft 0 (0%) 1 (0.3%)
0-499 sq ft 33 (7.0%) 22 (6.9%)
1000-1099 sq ft 55 (12%) 49 (15%)
1100-1299 sq ft 47 (10%) 35 (11%)
1300-1599 sq ft 84 (18%) 59 (18%)
1600-1899 sq ft 46 (9.8%) 26 (8.2%)
1900-2099 sq ft 26 (5.5%) 21 (6.6%)
2100-2399 sq ft 25 (5.3%) 15 (4.7%)
2400-2699 sq ft 16 (3.4%) 10 (3.1%)
2700-2999 sq ft 14 (3.0%) 6 (1.9%)
500-699 sq ft 46 (9.8%) 21 (6.6%)
700-099 sq ft 77 (16%) 54 (17%)
Unknown 10 7
hardships_1 704 277 (65%) 185 (66%) >0.9
Unknown 56 45
hardships_2 704 88 (21%) 62 (22%) 0.7
Unknown 56 45
hardships_3 704 106 (25%) 83 (30%) 0.2
Unknown 56 45
hardships_4 704 114 (27%) 90 (32%) 0.15
Unknown 56 45
hardships_5 704 74 (17%) 53 (19%) 0.6
Unknown 56 45
hardships_6 704 36 (8.5%) 36 (13%) 0.065
Unknown 56 45
welfare_1 725 152 (36%) 112 (38%) 0.6
Unknown 52 28
welfare_2 725 145 (34%) 101 (34%) >0.9
Unknown 52 28
welfare_3 725 54 (13%) 55 (18%) 0.031
Unknown 52 28
welfare_4 725 190 (44%) 151 (51%) 0.10
Unknown 52 28
welfare_5 725 100 (23%) 65 (22%) 0.6
Unknown 52 28
welfare_6 725 53 (12%) 35 (12%) 0.8
Unknown 52 28
welfare_7 725 56 (13%) 30 (10%) 0.2
Unknown 52 28

1 Mean (SD); n (%)

2 Wilcoxon rank sum test; Fisher's exact test; Pearson's Chi-squared test

Part IV. Some plots

load("~/GitHub/san/sa_survey.RData")

san %>% 
  filter(health != "NA") %>% 
  ggplot(aes(x = race_eth, fill = health)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2) +
  scale_fill_viridis_d(option = "E", begin = .2, end = .8) +
  facet_grid(~zip) +
  ggtitle("Responses by zip code and mental health status", 
          subtitle = "How often have you been bothered by the feeling nervous, anxious, or on edge") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))

san %>% 
  filter(anxious != "NA", worry != "NA", interest != "NA", down!= "NA") %>% 
  ggplot(aes(x = race_eth, fill = anxious)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2) +
  scale_fill_viridis_d(option = "E", begin = .2, end = .8) +
  facet_grid(~zip) +
  ggtitle("Responses by zip code and mental health status", 
          subtitle = "How often have you been bothered by the feeling nervous, anxious, or on edge") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))

san %>% 
  filter(anxious != "NA", worry != "NA", interest != "NA", down!= "NA", !is.na(race_eth)) %>% 
  ggplot(aes(x = race_eth, fill = worry)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2) +
  scale_fill_viridis_d(option = "E", begin = .2, end = .8) +
  facet_grid(~ zip) +
  ggtitle("Responses by zip code and mental health status", 
          subtitle = "How often have you been bothered by not being able to stop or control worrying") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))

san %>% 
  filter(anxious != "NA", worry != "NA", interest != "NA", down!= "NA", !is.na(race_eth)) %>% 
  ggplot(aes(x = race_eth, fill = interest)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2) +
  scale_fill_viridis_d(option = "E", begin = .2, end = .8) +
  facet_grid(~ zip) +
  ggtitle("Responses by zip code and mental health status", 
          subtitle = "How often have you been bothered by having little interest or pleasure in doing things") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))

san %>% 
  filter(anxious != "NA", worry != "NA", interest != "NA", down!= "NA", !is.na(race_eth)) %>% 
  ggplot(aes(x = race_eth, fill = down)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(.5), vjust = 0, size = 2) +
  scale_fill_viridis_d(option = "E", begin = .2, end = .8) +
  facet_grid(~ zip) +
  ggtitle("Responses by zip code and mental health status", 
          subtitle = "How often have you been bothered by feeling down, depressed, or hopeless") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))

san %>% 
  filter(pre_c19_ph != "NA", pre_c19_mh != "NA", !is.na(race_eth)) %>% 
  ggplot(aes(x = race_eth, fill = pre_c19_ph)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(.5), vjust = 0, size = 2) +
  scale_fill_viridis_d(option = "D", begin = .2, end = .8) +
  facet_grid(~ zip) +
  ggtitle("Responses by zip code and physical health prior to COVID-19") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))

san %>% 
  filter(pre_c19_ph != "NA", pre_c19_mh != "NA", !is.na(race_eth)) %>% 
  ggplot(aes(x = race_eth, fill = pre_c19_mh)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(.5), vjust = 0, size = 2) +
  scale_fill_viridis_d(option = "D", begin = .2, end = .8) +
  facet_grid(~ zip) +
  ggtitle("Responses by zip code and mental health prior to COVID-19") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))
san %>% 
  filter(front != "NA") %>% 
  ggplot(aes(x = race_eth, fill = front)) +
  geom_bar() +
  geom_text(aes(label = ..count..), stat = "count", position=position_stack(0.5), vjust = 0, size = 2, color = "white") +
  scale_fill_viridis_d(option = "B", begin = .2, end = .8) +
  facet_grid(~ zip) +
  ggtitle("Responses by zip code and identification as frontline worker") +
  xlab(NULL) + 
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))

san %>% 
  filter(front != "NA",  gender != "NA", work_hrs > 0 ) %>% 
  ggplot() +
  geom_col(aes(x = work_hrs, y = race_eth, color = gender, fill = gender), position = "dodge", width = .5) +
  facet_grid(~ zip) +
  scale_color_viridis_d(option = "E", begin = .2, end = .8) +
  scale_fill_viridis_d(option = "E", begin = .2, end = .8) +
  ggtitle("Responses by zip code and working hours per week") +
  xlab("Hours per week") + 
  ylab(NULL) +
  theme_light() +
  theme(axis.text.x = element_text(angle = 90, size = 9))